Jquery Validate - List of Classes
Solution 1
Looking at the source, I believe these are the only rules that can be used simply by adding classes:
- required
- url
- date
- dateISO
- number
- digits
- creditcard
As for how to use them, just add them into the class
attribute of your input
:
<input type='text' class='required creditcard' name='credit-card' />
You'll have to define other rules in the object you pass to validate
.
Solution 2
Most probably you are looking for this
http://elegantcode.com/wp-content/uploads/2010/03/Jquery-Validator-Cheat-sheet.pdf
Founded when I was looking for same easy to remember list of validation plugin rules. :)
Update: If you like to have all things together try this too:
http://marketblog.envato.com/resources/extensive-collection-cheatsheets-web-designers
user982853
Updated on June 15, 2022Comments
-
user982853 almost 2 years
This may be a very stupid question but i am looking for a list of the inline validation rules for the jquery form validator.
I know that i can find the js functions here:
but i am looking for a list of the simple inline classes like
email, url, phone, etc., and learn how to use them. I am just looking for a simple list. Thank you.
-
user982853 about 12 yearsSo is there a way to define these validations in the call but by class not field name?
-
Andrew Whitaker about 12 years@user982853: I'm not sure what you mean--If you want to define rules in the
validate
call you must use field names. Additionally, if you apply the class rules to elements, they must have aname
to be validated correctly. -
David Morin almost 10 yearsBeen looking for a list like this one for the last 2 days. Thanks!
-
Adrian P. almost 10 yearsI'm glad I can help other people. I also received help here. Cheers!