i m trying to put a page validator to check if there are records in the subgrid. If there is atleast one record in the subgrid it should progress to the next page otherwise it has to throw error. I have implemented a similar code ina different page and it is working fine. but for a different webform step this code isnt working. Can someone please tell me how we can debug a validator. My code is below
$(document).ready(function () {
if (typeof (Page_Validators) == 'undefined') return;
// Create new validator
var newValidator = document.createElement('span');
newValidator.style.display = "none";
newValidator.id = "SchoolPlacementvalidator";
newValidator.controltovalidate = "SchoolPlacement";
newValidator.errormessage = "<a href='#SchoolPlacement'>At least one Qualification item must be added to progress.</a>";
newValidator.evaluationfunction = function () {
var SchoolPlacement = $("#SchoolPlacement table tbody tr").length;
if (SchoolPlacement === 0) {
return false
}
else {
return true;
}
};
Page_Validators.push(newValidator);
});