Thursday, April 7, 2011

Table of Validation Descriptors

Here is the list of all validation descriptors:

Validation
Descriptor
                           Usage                                                                                                     
reqThe field should not be empty
maxlen=???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=???checks the length of the entered string to the required minimum. example "minlen=5"
alnumCheck the data if it contains any other characters other than alphabetic or numeric characters
alnum_sAllows only alphabetic, numeric and space characters
numCheck numeric data
alphaCheck alphabetic data.
alpha_sCheck alphabetic data and allow spaces.
emailThe field is an email field and verify the validity of the data.
lt=???
lessthan=???
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 "lt=1000"
gt=???
greaterthan=???
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 "gt=10"
regexp=???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.
dontselect=??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 'Select One', the validation description should be "dontselect=Select One"
dontselectchkThis validation descriptor is for check boxes. The user should not select the given check box. Provide the value of the check box instead of ??
For example, dontselectchk=on
shouldselchkThis validation descriptor is for check boxes. The user should select the given check box. Provide the value of the check box instead of ??
For example, shouldselchk=on
dontselectradioThis validation descriptor is for radio buttons. The user should not select the given radio button. Provide the value of the radio button instead of ??
For example, dontselectradio=NO
selectradioThis validation descriptor is for radio buttons. The user should select the given radio button. Provide the value of the radio button instead of ??
For example, selectradio=yes
selmin=??Select atleast n number of check boxes from a check box group.
For example: selmin=3
seloneMakes a radio group mandatory. The user should select atleast one item from the radio group.
eqelmnt=???compare two elements in the form and make sure the values are the same For example, 'password' and 'confirm password'. Replace the ??? with the name of the other input element.
For example: eqelmnt=confirm_pwd

No comments: