Forum Moderators: open

Message Too Old, No Replies

Writing Contents of Address Bar To Hidden Form Field

         

bushey

3:51 pm on Sep 10, 2004 (gmt 0)

10+ Year Member



Hi

Can anyone give me a snipet of code to write the contents of the address bar (http://www.example.com/?url=google.com/?search=keyword)into a hidden form field.

Thanks in advance
Chris

Receptional Andy

4:02 pm on Sep 10, 2004 (gmt 0)



I think this'll do it I think (the address bar is just the current url the visitor is on by the way). Put the script where you want the hidden field.


<script language="JavaScript" type="text/javascript">
<!--
addy=location.href;
document.write("<input type=hidden value="+addy+">");
//-->
</script>

bushey

4:36 pm on Sep 10, 2004 (gmt 0)

10+ Year Member



Cheers Andy