filmov
tv
javascript - How can I trigger an onchange event manually?
Показать описание
#short
#javascript
#event-handling
#dom-events
I'm setting a date-time textfield value via a calendar widget. Obviously, the calendar widget does something like this :
What I want is:
On changing value in the date-time textfield I need to reset some other fields in the page. I've added a onchange event listener to the datetimetext field which is not getting triggered, because I guess onchange gets triggered only when the element gets focus & its value is changed on losing focus.
Hence I'm looking for a way to manually trigger this onchange event (which I guess should take care of checking the value difference in the text field).
Any ideas?
#javascript
#event-handling
#dom-events
I'm setting a date-time textfield value via a calendar widget. Obviously, the calendar widget does something like this :
What I want is:
On changing value in the date-time textfield I need to reset some other fields in the page. I've added a onchange event listener to the datetimetext field which is not getting triggered, because I guess onchange gets triggered only when the element gets focus & its value is changed on losing focus.
Hence I'm looking for a way to manually trigger this onchange event (which I guess should take care of checking the value difference in the text field).
Any ideas?