Reputation: 5061
I have a calendar which comprise of an input tag and an image on click of image calendar popups comes and sets the value for input tag using javascript.
now i have added onchange event on input tag which doesnt gets triggered since m changing the value using javascript, so what should be done to trigger it i dont want to trigger it explcitly
i tried focusing on input on click of image and focus out on setting the data(into input element) but it didnt worked any workaround?
Upvotes: 1
Views: 282
Reputation: 51797
just tested what you described, it's the same problem here.
a simple workaround would be to call the onchange-method directly (where you're doing the .focus()/.blur() now)
Upvotes: 0
Reputation: 322492
You can call the onchange
handler manually.
Example: http://jsfiddle.net/NQCy7/
element.value = 'new value';
element.onchange();
Upvotes: 3