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 forms both on browser and server side.
It can generate to validate forms on the browser side before the forms are submitted. It can also validate forms on the server side using the class own PHP code.
Currently it supports several built-in validation types like: empty fields, e-mail address, URL, numeric value within optional range, length between a range, etc..
The way that errors are displayed after browser side validation is configurable and it works the same way in different browsers.
List of features :
---* Customizable
----------o Validation : (defining new field types, overriding validation functions , using regex , etc...)
----------o View : ability to choose between various ways of showing errors. currently "alert,div , nearFields, pageCenterDiv, formCenterDiv ,customizedDiv" are supported out of the box. and it's also possible to override the display function and show errors in the way you want.
---* Cross browser (IE6+, Firefox2+, Opera7+, Safari3+, All Mozilla based browsers)
---* Very well tested. More than 30 projects are currently using it
---* Easily integrate able , All of the PHP functions used in the class have prefix and also accepts prefix for JavaScript for preventing conflict with other JavaScript in the application
---* Ajax support : No official Ajax support at the moment but since you can completely overwrite the built in validation functions and error display functions you can do the validation with your own Ajax framework
---* Light weight : Because it does not use any JavaScript framework.
---* Extensible : Some design patterns like factory and chain of commands have been used in both JavaScript and PHP sides for ease of extensibility. Code is documented and also name of all of the methods and functions are self described.
---* PHP 4 & 5 compatible
---* Multilingual
---* XHML Valid
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.