It provides functions to fetch session, cookie, POST or GET form request values, as well other functions to perform several types of validation.
Currently it can validate a value as an e-mail address, a number, alphanumeric test, a date, state code with two characters, IP address, HTTP URL, check whether a value is defined, check the length of the value, provide a default for empty values, and compare two values.
This class can be used to validate Web form inputs according to several types of validation.
Currently the class provides the validation types:
- Field is empty
- Field is selected
- Value matches a regular expression
- Value is a e-mail address
- Two fields have the same value
- Text value is made of letters
- Text value length does not exceed a limit
- Field value is equal to a constant value
- A given number of selected or unselected options
This class can be used to generate Javascript code for validating Web forms.
It takes as parameter a list of form fields to be validated that details the field names, types of validations to be performed and the error messages to associate with each error.
Currently it supports validating fields by checking whether the values are not empty strings, values are valid e-mail addresses or the values are equal to a given number.