...

View Full Version : Querystring to input field



legionarius
06-10-2008, 10:29 PM
I'm using this script to get the HID variable from the querystring

<script type="text/javascript">
hid = window.location.search.substring(1);
document.write(hid);
</script>

instead of using document.write how do i modify this script to populate the value of HID into an input field?

thanks
Hector

tagnu
06-10-2008, 10:48 PM
How about this?


<input type="text" name="test" id="test"/>
<script type="text/javascript">
hid = window.location.search.substring(1);
document.getElementById('test').value=hid;
</script>



EZ Archive Ads Plugin for vBulletin Copyright 2006 Computer Help Forum