Hi;
I have a form in an html document with a hidden field. I would like to assign that field(referring_page) the value of the referring document. The form emails the different field values back to the customer.
Here is the non-working code I have so far:
<script language="Javascript">
function GETURL(waterform)
{
if (document.referrer&&document.referrer!=""
document.waterform.referring_page.value=(''+document.referrer+'<BR>');
}
//-->
</script>
...
<FORM METHOD=POST ACTION="/cgi-bin/mail.cgi" NAME="waterform">
...
<td valign="top"><INPUT NAME="c_WasItFound?" SIZE="12"></td></tr>
<td valign="top">Your mailing address:</td>
<td valign="top"><TEXTAREA NAME="h_address" COLS=40 ROWS="10"></TEXTAREA></td></
tr>
<td valign="top"></td>
<td valign="top" align="center"></td>
<td valign="top"><INPUT TYPE="hidden" VALUE=" " NAME="referring_page">
<INPUT TYPE=submit VALUE="Send comments" onsubmit="GETURL(waterform);" >
...
</table>
</FORM>
Thanks,
I have a form in an html document with a hidden field. I would like to assign that field(referring_page) the value of the referring document. The form emails the different field values back to the customer.
Here is the non-working code I have so far:
<script language="Javascript">
function GETURL(waterform)
{
if (document.referrer&&document.referrer!=""
document.waterform.referring_page.value=(''+document.referrer+'<BR>');
}
//-->
</script>
...
<FORM METHOD=POST ACTION="/cgi-bin/mail.cgi" NAME="waterform">
...
<td valign="top"><INPUT NAME="c_WasItFound?" SIZE="12"></td></tr>
<td valign="top">Your mailing address:</td>
<td valign="top"><TEXTAREA NAME="h_address" COLS=40 ROWS="10"></TEXTAREA></td></
tr>
<td valign="top"></td>
<td valign="top" align="center"></td>
<td valign="top"><INPUT TYPE="hidden" VALUE=" " NAME="referring_page">
<INPUT TYPE=submit VALUE="Send comments" onsubmit="GETURL(waterform);" >
...
</table>
</FORM>
Thanks,