Rules
| Description | Usage |
|---|---|
| alpha | Must contain alphabetic data only. |
| alpha_space | Must contain alphabetic data and allow spaces. |
| alphanumeric | Must contain alphabetic or numeric characters only. |
| alphanumeric_space | Must contain alphabetic or numeric characters and allow spaces. |
| date | Must contain date in YYYY-XX-XX or XX-XX-YYYY format. |
| Must contain a valid email address. | |
| equal=xxx sameas=xxx |
Compare two elements in the form and make sure the values are the same. For example, ‘password’ and ‘confirm password’. Replace the xxx with the name of the other input element. For example: equal=confirm_pwd |
| greaterthan=xxx gt=xxx |
Verify the data to be greater than the value passed. Valid only for numeric fields. example: if the value should be greater than 10 give validation description as “greaterthan=10” |
| lessthan=xxx lt=xxx |
Verify the data to be less than the value passed. Valid only for numeric fields. example: if the value should be less than 1000 give validation description as “lesstthan=1000” |
| maxlen=xxx maxlength=xxx |
Checks the length entered data to the maximum. For example, if the maximum size permitted is 25, give the validation descriptor as “maxlen=25” |
| minlen=xxx minlength=xxx |
Checks the length of the entered string to the required minimum. example “minlen=5” |
| notequal=xxx notsameas=xxx |
Compare two elements in the form and make sure the values are not the same. For example, ‘password’ and ‘confirm password’. Replace the xxx with the name of the other input element. For example: notequal=confirm_pwd |
| nourl | Check the data and make sure there are no URLs. |
| number numeric num |
Check for numeric data only. |
| postalcode | Check for Canadian Postal Code. |
| regexp=xxx | Check with a regular expression the value should match the regular expression. example: “regexp=^[A-Za-z]{1,20}$” allow up to 20 alphabetic characters. |
| required req mandatory |
The field should not be empty |
| select selone selectmandatory |
Makes a radio group mandatory. The user should select at least one item from the radio group. |
| selectdont=xx | This validation descriptor is for select input items (lists). Normally, the select list boxes will have one item saying ‘Select One’. The user should select an option other than this option. If the value of this option is ‘- Choose -’, the validation description should be “dontselect=- Choose -” |
| selmin=xx | Select at least n number of check boxes from a check box group. For example: selmin=3 |
| tel | Check for a telephone number with 7, 10 or 11 digits. |
| url | Check the data and make sure it is a URL. |
| zip | Check for US Zip Code with a length of 5 or 5 plus 4. |