0

I'm creating a form with some fancy interactivity which depends on the change event of radio buttons. As ie doesn't trigger this event until another element is focused I need to branch my code, but want to go down the feature detection rather than browser detection route.

Looking at a few resources (http://api.jquery.com/jQuery.support/, http://kangax.github.com/cft/) I can't find any implementation of detecting ie's buggy radio/checkbox change events.

Does anyone know how I might be able to detect it?

Sam Hanley
  • 4,707
  • 7
  • 35
  • 63
wheresrhys
  • 22,558
  • 19
  • 94
  • 162

1 Answers1

1

In my experience, click and keyup are the only event to trust in this case.

(function () {
  $('#yourRadio').bind('click keyup', function () {
    // check value with $(this).val()
  });
}());
Matt
  • 43,482
  • 6
  • 101
  • 102
  • 1
    Indeed, to detect change store the last selected button in some global context then in the click/keyup events check if the source element is different which means it's the new selected button. – Shadow The GPT Wizard Jan 24 '11 at 14:34
  • I had to alter this slightly as my form hides teh input so the click is on my – wheresrhys Jan 24 '11 at 15:07