Welcome to WebmasterWorld Guest from 35.153.73.72

Forum Moderators: open

Message Too Old, No Replies

Writing Contents of Address Bar To Hidden Form Field

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

New User

10+ Year Member

joined:June 21, 2003
posts:32
votes: 0


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

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

Senior Member

joined:Jan 27, 2003
posts:2534
votes: 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>
4:36 pm on Sept 10, 2004 (gmt 0)

New User

10+ Year Member

joined:June 21, 2003
posts:32
votes: 0


Cheers Andy