These example form fields demonstrate a number of techniques for customising TerraForm. These techniques require the inclusion of a custom settings file in order to define custom presets and datatypes. This file is included with the TerraForm attribute settingspath="settings_custom.cfm". To view the file and examine the code for the presets and datatypes, open the file /gallery/custom/settings_custom.cfm
Examples 1 and 3 use presets. Presets are good ways of building boilerplate form fields in whole or in part, where the field is based on existing formats and datatypes. A preset is nothing more than a default set of attributes you apply to your field. In example 1, the preset specifies the default format, datatype, pattern (a regular expression pattern that provides the validation), jsMask (a JavaScript regular expression that provides key filtering) and error. In example 3, the preset specifies the default name, format, datatype, prompt, valuelist, and displaylist -- basically the entire field.
Example 2 requires some custom validation. You could write custom form validation if you only wanted to use this field once [see this example for more on custom form validation]. But if it's something you'll use over, you may be better to build a datatype. In this case, the field simply specified datatype="palindrome".
Examples 4, 5, and 6 use validation to check whether the visitor has supplied the correct answer. A quiz datatype has been created to handle this decision. The developer simply supplies a correct attribute containing the answer, and the quiz datatype's validation simply checks that the entered value matches. As you can see, the datatype has no bearing on the appearance of the field, the format.