I wasn to be able to pass and ID such as '123456' from a URL:
http://www.mysite.com/page.html?ID=123456
to a hidden form field.
I found a Javascript that lets me write the ID to a page but I don't know how to add the value to the value="" bit of a hidden input field.
Any ideas much appreciated!
The JS I am using is:
<script>
function getQueryVariable(variable) {
var query = window.location.search.substring(1);
var vars = query.split("&");
for (var i=0;i<vars.length;i++) {
var pair = vars[i].split("=");
if (pair[0] == variable) {
return pair[1];
}
}
alert('Query Variable ' + variable + ' not found');
}
</script>