Validator.numberOfInvalids()

Validator.numberOfInvalids( errors )

Description: Returns the number of invalid fields.

Example:

Displays a summary of invalid fields after an invalid submit.

1
2
3
4
5
var validator = $( "#myform" ).validate({
invalidHandler: function() {
$( "#summary" ).text( validator.numberOfInvalids() + " field(s) are invalid" );
}
});