Skip to content

Instantly share code, notes, and snippets.

@johhansantana
Created October 31, 2015 17:09
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save johhansantana/299a65b35b5822a73b1c to your computer and use it in GitHub Desktop.
Save johhansantana/299a65b35b5822a73b1c to your computer and use it in GitHub Desktop.
jquery validate syntax
$('#contact_form').validate({
debug: true,
rules: {
name: "required", // should be: "user[username]"
email: { // should be: "user[email]"
required: true,
email: true
}
},
messages: {
name: "Please specify your name", // should be: "user[username]"
email: { // should be: "user[email]"
required: "We need your email address to contact you",
email: "Your email address must be in the format of name@domain.com"
}
}
});
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment