• Basics
  • Fields
  • Validation
Search »

Field Validation

In Form Tools 2.1.4, we added a field validation feature. This lets you assign rules to your form fields to ensure they meet certain criteria, e.g. to make them required fields, check they contain email addresses, numbers only, etc. This feature is entirely optional and only affects forms displayed within Form Tools and Form Builder forms. Your external forms are still totally separate and will still need to have their own validation added separately - just like before.

When you add a validation rule to a form field, it will affect all users (admin, client or end user via the Submission Accounts module), and regardless of the View they are using. Field validation is a blanket setting, defined once for the form fields and affects everything all forms within Form Tools, regardless of whether they are internal or external.

The Edit Field dialog

Textboxes: edit dialog, tab #3
Textboxes: edit dialog, tab #3
You can add validation rules through the Edit Field dialog, found by clicking the "edit" icon for a form field row on the Edit Form » Fields tab. There, click on the third "Validation" tab. Depending on the field type, you'll see something like the screenshot to the right.

Like the second "Settings" tab, validation rules are field type-specific: you'll see different rules depending on what type the field is. The screenshot to the right shows the available rules for the Textbox field type. Since textboxes can be used to store a variety of different things, it makes sense to offer a number of different validation options: required, valid email, letters only, numbers only and alphanumeric. But if you look at the validation options for, say, a radio button field type, you'll only see the "required" option. This is because none of the other validation rules would make sense for radio buttons!

For more information on the Edit Field dialog, see this documentation page. That section also contains information about each field type and the validation options they offer.

Customizing the Error Message

When you select a validation rule on the Edit Field dialog, an error message will be automatically pre-filled. You can customize the text to say whatever you want. Please note that the {$field} part of the string is a placeholder. It will be automatically converted to the display text of the form field, making it simple for users to identify what fields were entered incorrectly. We'd strongly suggest including it in your custom error message.