/
customizing_validation.html
44 lines (37 loc) · 1.89 KB
/
customizing_validation.html
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
---
layout: default
navPage: docs
heading: Customizing validation
breadcrumbs:
- User Documentation,/userdoc/
- Field Validation,/userdoc/field_validation/
- Customizing validation
prev: Field Validation,/userdoc/field_validation/
next: Field Types,/userdoc/field_types/
categories: userdoc
tags: fields,field_types,validation
---
{% include open_section.html nav='nav_userdoc_field_validation.html' selected='customizing_validation' %}
<p>
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.
</p>
<p>
Form Tools 2.1.x was designed alongside the <a href="{{site.baseurl}}/modules/custom_fields/">Custom Fields
module</a>. 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 <a href="{{site.baseurl}}/modules/field_type_google_maps/">Google Maps module</a> and
<a href="{{site.baseurl}}/modules/field_type_tinymce/">TinyMCE WYSIWYG module</a>.
The field validation is also controlled via that module.
</p>
<p>
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.
</p>
<p>
Read the <a href="{{site.baseurl}}/modules/custom_fields/">Custom Fields module</a> help documentation for more
information about customizing the validation.
</p>
{% include close_section.html %}