Skip to content

Instantly share code, notes, and snippets.

@bmeredith
Created July 5, 2015 03:49
Show Gist options
  • Save bmeredith/0b060b2586695352552b to your computer and use it in GitHub Desktop.
Save bmeredith/0b060b2586695352552b to your computer and use it in GitHub Desktop.
Overriding jQuery Validate
$.validator.prototype.checkForm = function () {
this.prepareForm();
for (var i = 0, elements = (this.currentElements = this.elements()) ; elements[i]; i++) {
if (this.findByName(elements[i].name).length != undefined && this.findByName(elements[i].name).length > 1) {
for (var cnt = 0; cnt < this.findByName(elements[i].name).length; cnt++) {
this.check(this.findByName(elements[i].name)[cnt]);
}
} else {
this.check(elements[i]);
}
}
return this.valid();
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment