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.
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
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”…
Sweet, found this article on google, saved me sometime…
Thanks!
Amazing find, I just had the same issue, and is no longer an issue!! Thanks for the post.
Saved me some time as well! Thanks for sharing!
Thanks for posting this. Saved me some time, as well.
Nice post, thanks for speeding that problem to close.
Very helpful! My company is still on IE6.
thanks blood!
that’s being really kind. not just keping it to urself but saving others wasting lots of time.
bless you.
frost.
Thanks a bunch!!! This saved me a lot of time!
Googled: ie6 onchange bug
First result on list and instant solution. Thank you for this article !
John
This does not seem to help for select elements. I have tried using onclick in both the select and option tags to no avail.
Hi,
I too have faced the same problem, but the solution of changing the event from onchange to onclick is not an acceptable solution since events are specific to design.
I have found an alternative solution.
—if you call function f1() in onchange event then before the function ends (or before returning from the function) call another function f2() which does nothing i.e function f2(){}.
Try this.. It worked for me..
-Regards,
Vikram
vikramjitsaha@hotmail.com
Oh thanks a lot ! I had the same problem, and now, it works !
Thank you !
What John said!
Thanks!