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

3 Responses to “IE 6 javascript onchange() problem”

  1. Mark Szu Says:

    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

  2. Mizui Says:

    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”…

  3. m0nk3y Says:

    Sweet, found this article on google, saved me sometime…
    Thanks!

Leave a Reply