simulate click on checkbox in msie
I was having problems getting a click simulation to work correctly in any MSIE browser. I was using the jquery.simulate.js plug-in since that is what the ui test suites are using. Regardless of simulation mechanism this problem is still around. I'm looking for idea or suggestions.
here is a link to the simulate plugin git, http://github.com/jquery/jquery-ui/blob/master/tests/jquery.simulate.js
- dispatchEvent: function(el, type, evt) {
if ( $.browser.msie && type === 'click' && el.type === 'checkbox' ) {
el.checked = true;
}
if (el.dispatchEvent) {
el.dispatchEvent(evt);
} else if (el.fireEvent) {
el.fireEvent('on' + type, evt);
}
return evt;
},
Yes, my current solution just keeps the check property in sync when click simulations take place on a checkbox. the simulation fires but the value is always wrong otherwise.
ideas?,
andrew