Skip to content

Instantly share code, notes, and snippets.

@peterson-umoke
Created June 13, 2019 10:47
Show Gist options
  • Save peterson-umoke/643f3add87283c34b6b51f95da23fba2 to your computer and use it in GitHub Desktop.
Save peterson-umoke/643f3add87283c34b6b51f95da23fba2 to your computer and use it in GitHub Desktop.
This code snippet is used to check for the value change of a hidden input field
var hiddenFieldID = $("#ins_appraisal_ins_appraisal_settingsins_appraisal_settings_idb");
var oldValueField = hiddenFieldID.val();
setInterval(function() {
if (oldValueField !== hiddenFieldID.val()) {
oldValueField = hiddenFieldID.val();
hiddenFieldID.val(oldValueField).trigger('change');
}
}, 1000);
$(hiddenFieldID).change(function() {
console.log('lkljsdf', $(this).val());
});
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment