Question Locked

Programmatically invoke onChange event

0 helpful
3 replies
Closed to new repliesThis discussion is closed. It stays readable, but it takes no new replies.

I am using a popup calendar to populate an input field. When the contents of this field change I need the onChange event to fire so that I can perform further updates. The onChange event "onChange=myFunction()" will fire if I manually type the date into the field but not if I populate the field using javascript!

How can I programatically invoke the onchange event?

3 replies

by tony hopkinson

Put the code you have in the onchange event handler in another function then call it from where ever you need it.

It's a better way to write event driven code anyway, gives you a much better design for testing.

This discussion is closed to new replies.