Skip to content

Instantly share code, notes, and snippets.

@craiem
Forked from martinnormark/manually-validate.js
Created March 26, 2013 14:00
Show Gist options
  • Save craiem/5245580 to your computer and use it in GitHub Desktop.
Save craiem/5245580 to your computer and use it in GitHub Desktop.
Js -> Validate Form
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