Click to See Complete Forum and Search --> : Passing parameters between two HTML pages
geets
01-17-2003, 01:27 PM
Hi,
I want to pass some parameters from one HTML page to another. Can i do it in href attribute of <a> tag. If so, how do i do that and how do i recive the parameters in the recieving page?
Thanks in advance.
-geets
gil davis
01-17-2003, 01:36 PM
http://developer.netscape.com/viewsource/goodman_url_pass/goodman_url_pass.html
geets
01-20-2003, 04:13 PM
Hi,
I tried passing the parameter but at the recieving page, i receive a blank string. I tried 3 ways and following is the code:
<form name="frm" method="post">
<input type="hidden" name="param1" value="val1">
<a href="http://host/directory/Frames.htm" onclick="javascript:fnSubmit()">FramePage</a></p>
</form>
<script language="javascript">
function fnSubmit()
{
frm.submit();
}
</script>
So that the parameter goes as name value pair. But i don't recieve anything at the recieving page.
<form name="frm" method="post">
href="http://host/directory/Frames.htm?param1=val1" onclick="javascript:fnSubmit()">FramePage</a></p>
</form>
<script language="javascript">
function fnSubmit()
{
frm.submit();
}
</script>
Here it doesn't display the page at all.
<form name="frm" method="post">
<a href="http://host/directory/Frames.htm" onclick="javascript:fnSubmit()">FramePage</a></p>
</form>
<script language="javascript">
function fnSubmit()
{
frm.action="http://host/directory/Frames.htm?param1=val1"
frm.submit();
}
</script>
Here, it shows the URL with the parameter and value but shows the page specified in href attribute and so doesn't pass the parameter value.
I capture the values at the secong page using 'location.search.substring(1)'
Could someone pls help.
Thanks.