User Guide

Table Of Contents
Validating form data using hidden fields 677
Hidden form field considerations
Consider the following rules and recommendations when determining whether and how to use
hidden form field validation:
Use hidden field validation if you want to validate data from standard HTML input tags. The
cfinput and cftextarea tags include a validateAt attribute that provides a simpler method
for specifying server-side validation.
Consider using hidden field validation with the cfinput and cftextarea tags if you specify
multiple validation rules for a single field and want to provide a separate error message for each
validation.
Do not use the suffixes listed in the table as field names.
Adding a validation rule to a field does not make it a required field. You must add a separate
_required hidden field to ensure user entry.
_cfformtelephone Standard U.S. telephone formats. Does not support international
telephone numbers.
Allows area codes with or without parentheses, and hyphens (-),
spaces, periods, or no separators between standard number
groups. Can be preceded by a 1 long-distance designator, and can
end with an up-to-5 digit extension, optionally starting with x. The
area code and exchange must begin with a digit in the range 1 - 9.
_cfformzipcode A 5-digit or 9-digit U.S. ZIP code. In 9-digit codes, the final four
digits must be preceded by a hyphen (-) or space.
_cfformemail A valid e-mail address. Valid address characters are a-zA-Z0-9_-
and the period and separator. There must be a single at sign (@) and
the text after the @ character must include a period, as in
my_address@MyCo.com or b-b.jones27@hisco.co.uk.
_cfformURL A valid URL. Must start with http:\\, https:\\, ftp:\\, file:\\, mailto:, or
news:. Can include, as appropriate, username and password
designators and query strings. The main part of the address can only
have the characters A-Za-z0-9 and -.
_cfformboolean A value that can be treated as a Boolean: Yes, No, True, False, 0, 1.
_cfformUUID A universally unique identifier (UUID) that follows the ColdFusion
format, xxxxxxxx-xxxx-xxxx-xxxxxxxxxxxxxxxx, where x is a
hexadecimal number.
_cfformGUID A unique identifier that follows the Microsoft/DCE format, xxxxxxxx-
xxxx-xxxx-xxxx-xxxxxxxxxxxx, where x is a hexadecimal number.
_cfformnoblanks The field must not include blanks. ColdFusion uses this validation
only if you also specify a _
required hidden field.
_cfformmaxlength The number of characters must not exceed the number specified by
the tag
value attribute.
_cfformregex,
_cfformregular_expression
The data must match a JavaScript regular expression specified by
the tag
value attribute.
_required, _cfformrequired Data must be entered or selected in the form field.
Field name suffix Verifies