I am not sure is this a bugs in jQuery when using .click()
function instead of .change()
function for checkbox. It's working well on jsfiddle
1: http://jsfiddle.net/fadlisaad/tSgbZ/16/ but not on the live page http://webcollect.viewscast.com/canonrepairmobile
You may test it with this sequence:
<INPUT TYPE="Hidden" ID="__OUTP__ResolveWay_7" NAME="__OUTP__ResolveWay_7" VALUE="">
which should be <INPUT TYPE="Hidden" ID="__OUTP__ResolveWay_7" NAME="__OUTP__ResolveWay_7" VALUE="1">
With this code:
$('input[name!="ResolveWay_7"]').click(function() {
$('input[name="ResolveWay_7"]').removeAttr('checked');
});
you make it so that each time there's a click on an input, the checkbox is deactivated. So when you click on the submit button (yes, that's also an input) it unchecks the checkbox.
I believe you only need to change the selector to $('input[type="checkbox"][name!="ResolveWay_7"]')
and it should work.
The problem is this piece of code:
$('input[name!="ResolveWay_7"]').click(function() {
$('input[name="ResolveWay_7"]').removeAttr('checked');
});
Your Continue button is also going to satisfy that jQuery selector as it is of type <input>
and is not called ResolveWay_7. Therefore when the Continue button is clicked, it will deselect the checkbox.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With