Watch this example on YouTube
To fix it replace
$.validator.addMethod('validatecheckbox', function (value, element, params) {
var isValid = true;
if ($(params)[0].fields[0][0].val() == true) {
if (($(element).val() == '' || $(element).val() == null)) {
isValid = false;
}
}
return isValid;
});
with
$.validator.addMethod('validatecheckbox', function (value, element, params) {var isValid = true;
if ($(params)[0].fields[0][0].checked == true) {
if (($(element).val() == '' || $(element).val() == null)) {
isValid = false;
}
}
return isValid;
});
No comments:
Post a Comment