I'm working with jquery.
And i have text input in a form, i would like to process the change event.
$("#my_input").change(function(){alert('123');});
the event is fired normally when i edit the field manually, but when i change the field's value with a script (sometimes with an external script) it doesn't work.
is there any solution ?
and thanks in advance.
The change event is not designed to detect programmatic changes. You can trigger the event manually when setting the value, though:
$('#my_input').trigger('change');
shortcut:
$('#my_input').change();
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With