Take the 2-minute tour ×

I have a page which has a form and say 3 input radio-buttons and I want to run some code when any of them are changed, so my code looks like this

dojo.query("#ze_form > input:radio").onchange(function () {
    alert("onchange fired!");

this works fine in normal web browsers, but in IE7 the alert is displayed only after clicking on a radio button, then clicking outside somewhere! It fires when it looses focus it appears!

Notice: in the console and previously doing alerts and stuff, I can see that my query selector does in fact select the correct radio buttons.

What is this strange phenomenon?

share|improve this question

1 Answer 1

up vote 0 down vote accepted

IE7 doesn't fire the onChange event until the radio button loses focus. Your alternative is to connect to the onClick event.

share|improve this answer
Yep, I went with that alternative. Strange though, why doesnt ie fire the onchange as it should, its not like its called onloosefocus? –  rapadura Sep 5 '12 at 14:34

Your Answer


