.live("change") on a checkbox + IE not working completely
Hello,
I have some code and it wasn't working at all in IE and then I found that there was a bug relating to it.
So I downgraded to using 1.4.1 and the code works, but not completely. When I first check the checkbox in IE it does nothing, it's only when I check it for the second time (uncheck and then check again) that it changes the values accordingly. The select form elements do work in 1.4.1 so I did not post the code.
Code:
- var base = 0;
var buiten = 0;
var binnen = 0;
var bagage = 0;
- jQuery("#i_bagage").live("change", function(e) {
if (jQuery(this).is(':checked')) {
bagage = parseFloat(jQuery(this).val());
} else {
bagage = 0;
}
updateResult();
});
function updateResult () {
var i = base + binnen + buiten + bagage;
if(isNaN(i)) { i = 0.00; }
i = Math.abs(i);
i = parseInt((i + .005) * 100);
i = i / 100;
s = new String(i);
if(s.indexOf('.') < 0) { s += '.00'; }
if(s.indexOf('.') == (s.length - 2)) { s += '0'; }
jQuery('#result').html(s);
}