Validating function
Name | Description |
---|---|
validateString | Is passed the input’s value as a string. |
validateNumber | Use this instead of validateString when only numeric values are acceptable. Parsley will parse the input’s value and pass the number, or reject the value if it’s not an acceptable number |
validateDate | Define this to create date values. Parsley will parse the input’s value and pass the date, or reject the value if it’s not an acceptable date. |
validateMultiple | Is passed an array of values, in the case of checkboxes. |
Requirement parameters
Value of requirementType | Description |
---|---|
'string' | The most generic kind; requirement passed as is, with no checking. |
'integer' | For integers only (e.g. used by minlength ) |
'number' | To be used when decimal numbers are acceptable |
'date' | To be used for dates. |
'regexp' | The requirement can be either a full regexp string (e.g. /hel+o/i ) or just a simple expression (e.g. hel+o ) |
'boolean' | Any value other than "false" will be considered to true , including the empty string. This is so data-parsley-required and data-parsley-required=true be treated the same way. |