Xataface allows you to add validation rules to fields using the fields.ini file
A common requirement for forms is to have some validation rules. Here are some example validation rules:
Example 1: Make 'Username' a required field
Placing the above inside the fields.ini file will cause the Username field to be a required field.
Example 2: Username must be between 6 and 16 characters long
For this rule we will use a regular expression.
Example 3: Email field must contain a valid email address
Available validation rules
Xataface uses the PEAR library HTML_Quickform for validation, so any of the validators available in this package will be available in Xataface. Some of the available validation rules include:
Default validation rules
There are certain validation rules that are automatically applied to fields of with certain characteristics. For example, any field designated NOT NULL in the SQL table definition will automatically be a 'required' field. At the time of this writing, that is the only 'default' validation rule applied, but more may be added in the future if their addition makes sense.