One of the goals of TerraForm is to harness together the range of cool form solutions into one cohesive environment. Rather than adding our own client-side validation, we have designed TerraForm to integrate with the popular qForms package by PengoWorks. You can install and apply qForms to your TerraForm form just like any other form. However, we've made it a little easier for you.
With help from qForms, you can instruct TerraForm to provide basic client-side validation automatically - think of qForms as a subcontractor on your form's work site. Simply download the qForms API and install into your site as instructed. Add the following attributes to your
cf_terraform tag (insert the appropriate web path to the qForms API):
qForms="yes" qFormsPath = "/lib/"
For convenience, you may like to add the following lines to your
defaults.cfm settings file. This will save you having to add the attributes to each form:
<cfparam name="Attributes.qForms" default="yes"> <cfparam name="Attributes.qFormsPath" default="/lib/">
That's all you need to do to get started with qForms. You don't need to call the qForm() constructor, as TerraForm will generate the code for this automatically (view source and search for
new qForm). TerraForm will also generate basic validation requests to the qForms (such as required fields) for you automatically. To see what validation requests TerraForm will generate for each datatype, view your
datatypes.cfm settings file and search for
A sample is available for download in the Code Gallery.