Usage: http://www.position-relative.net/creation/formValidator/demoValidators.html
1. Introduce js jquery. js and jquery. validateEngine. js into the page.
2. Write the class such as class = "validate [required]" on the form to be verified. Available verification attributes:
Validate [required]
Validate [required, custom [url]
Validate [required, equals [password]
Validate [required, funcCall [checkHELLO]: Call the custom function checkHELLO during verification.
Function checkHELLO (field, rules, I, options ){
If (field. val ()! = "HELLO "){
// This allows to use i18 for the error msgs
Return options. allrules. validate2fields. alertText;
}
}
Validate [required, minSize [6]
Validate [required, maxSize [6]
Validate [required, custom [integer], min [-5]
Validate [required, custom [integer], max [50]
Validate [custom [date], past [2010/01/01]
Validate [custom [date], future [NOW]
Validate [custom []
Date
An ISO date, YYYY-MM-DD
Number
Floating points with an optional sign. ie.-143.22 or. 77 but also + 234,23
Integer
Integers with an optional sign. ie.-635 + 2201 738
Ipv4
An IP address (v4) ie. 127.0.0.1
OnlyNumberSp
Only numbers and spaces characters
OnlyLetterSp
Only letters and space characters
OnlyLetterNumber
3. Verify that $ ("# formID"). validationEngine () is executed in document. onload ();
4. Determine whether to pass jQuery ('# formID'). validationEngine ('validate') and return bool Value