valid(): Check all elements. Fixes #791 - valid() validates only the first (invalid) element

This commit is contained in:
Jörn Zaefferer
2013-06-24 14:59:22 +02:00
parent 1b08c8cdb0
commit 6f268031af
2 changed files with 5 additions and 4 deletions

View File

@@ -102,7 +102,7 @@ $.extend($.fn, {
var valid = true;
var validator = $(this[0].form).validate();
this.each(function() {
valid = valid && validator.element(this);
valid = validator.element(this) && valid;
});
return valid;
}