set value by name in hidden field javascript code example
Example: javascript change hidden input value
document.getElementById("myHiddenInputID").value = "MyNewValue";
document.getElementById("myHiddenInputID").value = "MyNewValue";