Rachel
Rachel

Reputation: 235

jquery .change and IE checkbox issues

I have had this problem before however the previous solution isn't working because there is an added complication with a function call. I have this code and it works fine in all browsers apart from IE.

 $('#HoldPaymentM').change(function(){$('#HoldPaymentW')[0].checked=$('#HoldPaymentM')[0].checked;CallCalc('calc');});
 $('#HoldPaymentW').change(function(){$('#HoldPaymentM')[0].checked=$('#HoldPaymentW')[0].checked;CallCalc('calc');});

If I change it to this it part works but keeps initialising the function call (which is not the desired behaviour

     $('#HoldPaymentW').bind($.browser.msie? 'propertychange': 'change', function() {
        $('#HoldPaymentM')[0].checked=$('#HoldPaymentW')[0].checked;CallCalc('calc');
        });

 $("#HoldPaymentM").bind($.browser.msie? 'propertychange': 'change', function() {
    $('#HoldPaymentM')[0].checked=$('#HoldPaymentW')[0].checked;CallCalc('calc');
    });

Could someone please help me discover the error of my ways? Changing "change|" to "click" doesn't work on this occasion.

Kind regards Rachel

Upvotes: 1

Views: 314

Answers (1)

Thierry Blais
Thierry Blais

Reputation: 2858

This doesn't work?

$('#HoldPaymentW').bind('change', function() {
        $('#HoldPaymentM')[0].checked=$('#HoldPaymentW')[0].checked;CallCalc('calc');

        });

Thses days I'm using $('selector').on('change', function(e){/*do stuff*/}); all the time and it's working cross browser...

Upvotes: 1

Related Questions