I'm attempting to populate a hidden field with this JavaScript code:
var msg = window.location.href.match(/\?FieldName=([^#?&]*)/);
if (msg) {
document.getElementById("FieldID").value = decodeURIComponent(msg[1]);
}
Form looks like this:
<form onsubmit="return Confirm2.render('Are you sure?');" parentpageid="####" siteid="####" pageid="####" action="formurl.com/" method="post" id="formid">
<input type="hidden" id="FieldID" name="FieldName" VALUE="" />
</form>
Any tips?