I am using the JQuery validation plugin. I am providing a custom showError function as so:
var errorHandler = function(errorMap, errorList) {
console.log("count: " + this.errorList.length);
var text = "";
if (this.errorList.length > 0) {
text = "Please correct the following errors: ";
for (var i = 0; i < this.errorList.length; i++) {
text += "* " + this.errorList[i].message.errorCode + "<br>";
}
}
$('#oopDialogErrorContainer').html(text);
this.defaultShowErrors();
}
My issue is that I would like to have access to ALL existing errors in the form. The form has many fields, but when errorHandler is called (this function is passed to validate() as the showError option), the errorList contains only the errors from the field last validated. In examining the validator object, there is nowhere that all current errors are stored. Do I need to manage this myself? (It seems so but I might be missing something.
http://docs.jquery.com/Plugins/Validation/validate#options
errorLabelContainerand…
errorContainer