trigger onchange event manually

Posted by Anitha on Stack Overflow See other posts from Stack Overflow or by Anitha
Published on 2010-05-18T10:54:30Z Indexed on 2010/05/18 11:10 UTC
Read the original article Hit count: 332

Filed under:
|

Hi all,

I'm setting a date-time textfield value via a calendar widget. Obviously, the calendar widget does something like this : document.getElementById('datetimetext').value = date_value;

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 ?

Thanks in advance, Anitha

© Stack Overflow or respective owner

Related posts about JavaScript

Related posts about onchange