Hi Justin,
Thank you for this workaround. I tried to check this out for one check box initially by updating your code, but the expected result was coming as it allows me to submit the form though I didn't that particular check box. When I debug the code, the control was going to the line high lighted in yellow, and then I pressed F10, then the control was transferred directly to next high lighted line in yellow and then it comes out as I again pressed F10.
$(document).ready(function () {
// Section 1 checkbox list
if ((!$('#mxr_inwindowsstore').is(':checked'))) {
addValidator('mxr_inwindowsstore', 'mxr_inwindowsstore_label');
}
function addValidator(fieldName, fieldLabel) {
debugger;
if (typeof (Page_Validators) == undefined) return;
var newValidator = document.createElement('span');
newValidator.style.display = "none";
newValidator.id = fieldName + "Validator";
newValidator.controltovalidate = fieldName;
newValidator.errormessage = "<a href='#" + fieldName + "_label'>" + fieldLabel + " not checked.</a>";
newValidator.validationGroup = "";
newValidator.initialvalue = "";
newValidator.evaluationfunction = function () {
// var value = $("#" + fieldName).val();
var value = $("#" + fieldName).is(":checked");
// if (value == null || value == "")
if(value == false){
return true;
} else {
return false;
}
};
function removeValidator(fieldName) {
Page_Validators = $.grep(Page_Validators, function (item) {
return item.id !== fieldName + "Validator";
});
}
// Section1 check box list onchange
$("#mxr_inwindowsstore").change(function () {
debugger;
if (this.checked) {
removeValidator('mxr_inwindowsstore');
}
});
}
});
Could you please tell me help me here?
Regards,
Leo