Answers for "onchange value in hidden input"

0

javascript change hidden input value

document.getElementById("myHiddenInputID").value = "MyNewValue";
Posted by: Guest on August-01-2019
0

onchange value in hidden input

//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.
Posted by: Guest on November-19-2020

Code answers related to "onchange value in hidden input"

Code answers related to "Javascript"

Browse Popular Code Answers by Language