Javascript Alterar valor de entrada oculto
document.getElementById("myHiddenInputID").value = "MyNewValue";
Grepper
document.getElementById("myHiddenInputID").value = "MyNewValue";
//in the HTML: <input id="myValue" type="hidden" name="myValue" value="">
$(function(){
var $hello= $('[id$="myValue"]');
$hello.on("change", function(){ //bind() for older jquery version
alert('hey');
}).triggerHandler('change'); //could be change() or trigger('change')
});
//Then, each time you change the value of targeted hidden inputs, trigger handler, e.g:
$('#myValue').val('the new value').triggerHandler('change');
//That's because onchange event is not fired automatically changing its value programatically.
STUPID CODE!!!