I am trying to get an html form to grab a value from a javascript code. I'd like for the hidden field "SubID" to grab the value of the javascript function. This is what I have so far.. what am I doing wrong:
<form action="" method="post">
<fieldset><input name="firstname" type="text" placeholder="First Name" /></fieldset>
<input type="hidden" name="SubID" value="uid1">
<fieldset><button id="contact-submit" name="submit" type="submit" data-submit="...Sending">Submit</button></fieldset>
<script type="text/javascript">
function getCookie(name)
{
var re = new RegExp(name + "=([^;]+)");
var value = re.exec(document.cookie);
return (value != null) ? unescape(value[1]) : null;
}
var uid1 = document.write(getCookie("uid"));
</script>