Skip to content

Instantly share code, notes, and snippets.

@martinnormark
Created January 11, 2013 22:44
Show Gist options
  • Save martinnormark/4514627 to your computer and use it in GitHub Desktop.
Save martinnormark/4514627 to your computer and use it in GitHub Desktop.
Programatically call jQuery validate
validate: function () {
var form = this.$el.is("form") ? this.$el : this.$el.closest("form");
if (!form.is("form")) {
form = this.$el.find("form");
}
return form.data().unobtrusiveValidation.validate();
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment