Debiprasad
Debiprasad

Reputation: 6183

Weird issue on IE (IE9 and lower) with JavaScript (jQuery)

I am experiencing a weird problem on IE (IE 9 and lower).

I have a form having a select and a radio. When anyone changes anything in the select or radio, it calculates the total price.

Here is the code: http://jsfiddle.net/Debiprasad/DLQ82/8/

It works fine in all browsers. But when I am testing this on IE: When I am changing the select value, then it works fine. But when I am changing the value radio, then it does not work.

The weird part is, if I added an alert to any of the functions, which executed when the value of radio changes, then it works fine on IE. What could be the problem and how to fix this?

Upvotes: 0

Views: 165

Answers (1)

robertc
robertc

Reputation: 75777

In IE, the change event on radio and checkbox controls only fires when the element loses focus, unlike other browsers.

I think jQuery fixed their change event to use propertychange in IE some time ago, you can see this by changing the jQuery version in jsFiddle to 1.3.2 and observing the different behaviour. Which version of jQuery are you using locally?

Upvotes: 3

Related Questions