ASP.NET 2.0. Lets say i have two Validation Groups valGrpOne and valGrpTwo; and two Validation Summaries valSummOne and valSummTwo; Reason for breaking up sections is purely
Here is another simple and generic method for validating against multiple groups.
// Page_ClientValidate only shows errors from the last validation group.
// This method allows showing for multiple groups
function Page_ClientValidateMultiple(groups) {
var invalidIdxs = [];
var result = true;
// run validation from each group and remember failures
for (var g = 0; g < groups.length; g++) {
result = Page_ClientValidate(groups[g]) && result;
for (var v = 0; v < Page_Validators.length; v++)
if (!Page_Validators[v].isvalid)
invalidIdxs.push(v);
}
// re-show any failures
for (var i = 0; i < invalidIdxs.length; i++) {
ValidatorValidate(Page_Validators[invalidIdxs[i]]);
}
// return false if any of the groups failed
return result;
};