User Guide

202 Chapter 2: ColdFusion Tags
In addition to the listed attributes, you can use the following HTML attributes in the cfform tag
without using the
passThrough attribute. The tag does not use these attributes, but includes
them in the HTML of the
form tag that it generates and returns to the browser:
validate Optional Verifies a value’s format:
date: US date
mm/dd/yyyy
eurodate: European date dd/mm/yyyy
time: time
hh:mm:ss
float: floating point entry
integer: integer entry
telephone: telephone
###-###-####. Separator: hyphen or
blank. Area code and exchange must begin with a digit 1 –
9.
zipcode: (U.S. formats only) 5-digit
##### or 9-digit
#####-####. Separator: hyphen or blank.
creditcard: must be a 13 to 16 digit integer after stripping
blanks and dashes; uses the mod10 algorithm.
social_security_number:
###-##-####. Separator: hyphen
or blank.
regular_expression: matches input against regular
expression specified by the
pattern attribute.
onValidate Optional Custom JavaScript function to validate user input. The form
object, input object, and input object values are passed to
the routine, which should return True if validation succeeds,
and False otherwise. If used, the
validate attribute is
ignored.
pattern Required if
validate =
"regular_
expression"
JavaScript regular expression pattern to validate input. Omit
leading and trailing slashes. For examples and syntax, see
Chapter 27, “Building Dynamic Forms,” in Developing
ColdFusion MX Applications.
message Optional Message text to display if validation fails.
onError Optional Custom JavaScript function to execute if validation fails.
size Optional Size of input control. Ignored, if
type = "radio" or
"checkbox".
maxLength Optional Maximum length of text entered, if
type = "Text" or
"password".
checked Optional Selects a control. No value is required.
Applies if
type = "radio" or "checkbox".
Optional: you can enter the following values:
true (equivalent to
checked)
false (equivalent to omitting the attribute)
passThrough Optional Passes one or more arbitrary attribute-value pairs to the
HTML code that is generated for the tag. You can use either
of the following formats to include the quotation marks
around the attribute value:
passthrough="ID=""myID"""
passthrough=’ID="myID"’
The second format, which surrounds all the attribute-value
pairs to be passed through in single quotation marks is
clearer, particularly when you pass multiple HTML attributes.
Attribute Req/Opt Default Description