IE 6 javascript onchange() problem
February 6th, 2008
I really hate IE6, but as it is still so common it is important to support it. I recently ran into a problem with the javascript onchange function. I was using onchange to update a text box on the page when the check box was selected. I was using “…onchange(this.checked)…” This worked fine for everything except IE6. It turns out that IE doesn’t fire the onchange state until the checkbox loses focus and so my update was not occurring.
The simple way around for this problem was to change onchange() to onclick(). The function now works in all browsers.
Sphere: Related Content
September 18th, 2008 at 4:03 am
Great blog - it saves me some time.
I also found out that IE has problem with getting the selected value of the radio button by id. The way around is to use form.button_name
November 9th, 2008 at 7:07 pm
Thanks for confirming the problem in IE.
“onchange” should be easy to implement in a browser though
Nothing like the CSS maze implementation…
Anyway I changed the code to “onclick”…
November 17th, 2008 at 12:43 pm
Sweet, found this article on google, saved me sometime…
Thanks!