DOCUMENTATION

  • Field Types
  • Fields
  • Validation
Search »

Customizing validation

The "out the box" validation rules for each field type should be sufficient for the majority of situations. However, it's possible you may need to add your own validation rules.

Form Tools 2.1.x was designed alongside the Custom Fields module. This module lets you customize the very field types that you can use within Form Tools (radio buttons, textboxes etc.), and allows the script to be extended to add whatever custom field types you want, such as the Google Maps module and TinyMCE WYSIWYG module. The field validation is also controlled via that module.

As mentioned earlier, how a field is validated is totally dependant on the field type. For example, the test to confirm that a field has a value (i.e. "is required") is different between textboxes and phone number fields. With phone number fields, the code would need to look at every field that makes up the phone number and check each one individually. As such, all available rules are defined alongside the field types themselves.

Read the Custom Fields module help documentation for more information about customizing the validation.