User Guide
690 Chapter 3: ColdFusion Functions
Parameters
Usage
The IsValid function lets you assure that validation is performed on the server. You can use the
cfparam tag to perform equivalent validation.
Parameter Description
type The valid format for the data; one of the following. For detailed information on
validation algorithms, see “Validating form data using hidden fields” in Chapter 28,
“Validating Data,” in ColdFusion MX Developer’s Guide.
• any: any simple value. Returns false for complex values, such as query objects;;
equivalent to the
IsSimpleValue function.
• array: an ColdFusion array; equivalent to the
IsArray function.
• binary: a binary value;; equivalent to the
IsBinary function.
• boolean: a Boolean value: yes, no, true, false, or a number; equivalent to the
IsBoolean function.
• creditcard: a 13-16 digit number conforming to the mod10 algorithm.
• date or time: any date-time value, including dates or times;; equivalent to the
IsDate function..
• email: a valid email address.
• eurodate: any date-time value, including US date formats and time values,
• float or numeric: a numeric value; equivalent to the
IsNumeric function.
• guid: a Universally Unique Identifier of the form
"XXXXXXXX-XXXX-XXXX-XXXX-
XXXXXXXXXXXX
" where ‘X’ is a hexadecimal number.
• integer: an integer.
• query: a query object; equivalent to the
IsQuery function.
• range: a numeric range, specified by the
min and max attributes.
• regex or regular_expression: matches input against
pattern attribute.
• ssn or social_security_number: A U.S. social security number.
• string: a string value, including single characters and numbers
• struct: a structure; equivalent to the
IsStruct function.
• telephone: a standard US telephone number.
• URL: an http, https, ftp, file, mailto, or news URL,
• UUID: a ColdFusion Universally Unique Identifier, formatted ‘
XXXXXXXX-XXXX-
XXXX-XXXXXXXXXXXXXXX
’, where ‘X’ is a hexadecimal number. See CreateUUID.
• USdate: a U.S. date of the format mm/dd/yy, with 1-2 digit days and months, 1-4
digit years.
• variableName: a string formatted according to ColdFusion variable naming
conventions.
• zipcode: U.S., 5- or 9-digit format ZIP codes.
•
value The value to test
min The minimum valid value; used only for
range validation
max The maximum valid value; used only for range validation
pattern A JavaScript regular expression that the parameter must match; used only for
regex or regular_expression validation.