Created
October 31, 2015 17:09
-
-
Save johhansantana/299a65b35b5822a73b1c to your computer and use it in GitHub Desktop.
jquery validate syntax
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
$('#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