User Guide

Table Of Contents
About ColdFusion MX validation 665
Data validation types
The following table lists the types of data you can validate when you use most ColdFusion
validation techniques. It does not include mask validation. Some validation types are not available
for all techniques; in these cases the table indicates the limitations. The
onBlur and onSubmit
validation algorithms for Flash format forms might vary from those described in the following
table, and most commonly have less functionality. For more detailed descriptions of the onServer
validation algorithms, see the table in “Validating form data using hidden fields” on page 675.
Type field Description
date When validating on the server, allows any date/time format that returns true in
the
IsDate function, including a time value. When validating on the client, same
as USdate.
USdate * A U.S. date of the format mm/dd/yy, with 1- or 2-digit days and months, and 1-
through 4-digit years. The separators can be slash (/), hyphen (-), or period (.)
characters
eurodate * A date of the format dd/mm/yy, with 1- or 2-digit days and months, and 1-
through 4-digit years. The separators can be slash (/), hyphen (-), or period (.)
characters.
time * When validating on the server, allows any date/time format that returns True in
the
IsDate function, including a date value. When validating on the client,
allows a time of format hh:mm[:ss] [A/PM].
float * A number; allows integers. When validating form fields on the server, integer
values are converted to real numbers.
numeric A number; allows integers. When validating form fields on the server, integer
values are unchanged.
integer * An integer.
range * A numeric range specified by a
range attribute or max and min attributes.
boolean A value that can be converted to a Boolean value: Yes, No, True, or False, (all
case-independent), or a number.
telephone * Standard U.S. telephone formats. Allows an initial 1 long-distance designator
and up to 5-digit extensions, optionally starting with x.
zipcode * U.S. 5- or 9-digit ZIP code format #####-####. The separator can be a
hyphen (-) or a space.
creditcard * Strips blanks and dashes; verifies number using mod10 algorithm. The number
must have 13–16 digits.
ssn * or
social_security_
number *
US. Social Security number format, ###-##-####. The separator can be a
dash (-) or a space.
email * A valid e-mail address of the form name@server.domain. ColdFusion validates
the format only; it does not check that entry is a valid active e-mail address.
URL * A valid URL pattern; supports http, https, ftp file, mailto, and news URLs.
guid * A unique identifier that follows the Microsoft/DCE format, xxxxxxxx-xxxx-xxxx-
xxxx-xxxxxxxxxxxx, where x is a hexadecimal number.