User Guide

Table Of Contents
676 Chapter 28: Validating Data
Use the following suffixes at the end of hidden form field names to specify the validation type.
The type identifier always starts with an underscore. Several validation rules have two names you
can use. The names that do not start with “_cf were used in earlier releases and are retained for
backward compatibility. For consistency and clarity, Macromedia recommends using the names
that start with “_cf” in new forms.
Field name suffix Verifies
_integer, _cfforminteger An integer of the range -2,147,483,648 — 2,147,483,647. Treats
the initial characters “$ ¤ ¥ £ +” as valid input, but removes them
from the number.
_cfformnumeric Any numeric value. Treats the initial characters “$ ¤ ¥ £ +”as valid
input, but does NOT remove them from the number.
_float, _cfformfloat Any value (including an integer) that can be represented as a
floating point number with up to 12 significant digits. Treats the initial
characters “$ ¤ ¥ £ +” as valid input, but removes them from the
number.
Converts input data to a real number; for example a dump of an
integer value on the action page includes a decimal point followed
by a 0.
_range, _cfformrange A numeric value within boundaries specified by the
value attribute.
Specify the range in the value attribute using the format
“min=minvalue max=maxvalue.” You cannot specify a custom error
message for this validation.
_date, _cfformdate A date in any format that ColdFusion can understand; converts the
input to ODBC date format. Allows entry of a time part, but removes
it from the ODBC value.
_cfformusdate A date in the form m/d/y, m-d-y , or m.d.y, The m and d format can
be 1 or 2 digits; y can be 2 or 4 digits. Does not convert the string to
an ODBC value and does not allow a time part.
_eurodate, _cfformeurodate A date in the form d/m/y, d-m-y, or d.m.y. The m and d format can
be 1 or 2 digits; y can be 2 or 4 digits. Converts the input to ODBC
date format. Allows entry of a time part, but removes it from the
ODBC value.
_time, _cfformtime A time. Can be in 12-hour or 24-hour clock format, and can include
seconds in the form hh:mm:ss or a case-independent am or pm
indicator.
Converts the input to ODBC time format. Allows entry of a date part,
but removes it from the ODBC value.
_cfformcreditcard After stripping blanks and dashes, a number that conforms to the
mod10 algorithm. Number must have 13-16 digits.
_cfformSSN,
_cfformsocial_security_number
A nine-digit Social Security number. Can be of the form xxx-xx-xxxx
or xxx xx xxxx.