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.
Type field | Description |
---|---|
date |
When validating on the server, allows any date/time format that returns true in the |
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 |
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 |
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_ |
US. Social Security number format, ###-##-####. The separator can be a dash (-) or a space. |
email * |
A valid e-mail address of the form [email protected]. 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. |
uuid * |
A universally unique identifier (UUID) that follows the ColdFusion format, xxxxxxxx-xxxx-xxxx-xxxxxxxxxxxxxxxx, where x is a hexadecimal number. |
regex * or regular_expression * |
Matches the value against a regular expression specified in a |
* Indicates attribute values that are not valid for the cfargument
tag.
Note: For more details on how ColdFusion handles data when it does onServer and hidden field validation, see Validating form data using hidden fields
The following validation types can only be used in cfinput
tags:
Type | Description |
---|---|
maxlength |
Limits the input to a maximum number of characters specified by a |
noblanks |
Does not allow fields that consist only of blanks. ColdFusion uses this validation only if the |
SubmitOnce |
Used only with |
You can use the following validation types in cfparam
and cfargument
tags and the IsValid
function only:
Type | Description |
---|---|
any |
Any type of value |
array |
An array of values |
binary |
A binary value |
query |
A query object |
string |
A string value or single character |
struct |
A structure |
variableName * |
A string formatted according to ColdFusion variable naming conventions. |
* This value is not valid for the cfargument
tag type
attribute. The cfargument
tag does support component names as type
attribute values. For more information, see cfargument
in CFML Reference.