User Guide
134 Chapter 2: ColdFusion Tags
Usage
This tag requires an end tag.
Some custom control tags that you can use within this tag require the client to download a Java
applet; they might execute slightly more slowly than using an HTML form element to get the
same information. In addition to regular HTML form elements, you can use the following
custom control tags within the
cfform tag:
• cfinput Creates and validates an input element (radio button, text box, check box)
• cfselect Creates a drop-down list box
• cfslider Creates a slider control (Java support required)
• cftextinput Creates a text input box (Java support required)
• cftree Creates a tree control (Java support required)
• cfgrid Creates a grid control to display tabular data (Java support required)
• cfapplet Embeds a registered Java applet (Java support required)
All of these control tags require that the browser is JavaScript-enabled.
If you use this tag after the
cfflush tag on a page, an error is thrown.
The
method attribute is automatically set to post; if you specify a value, it is ignored.
If you specify a value in quotation marks, you must escape them by doubling them; for example:
passThrough = "readonly = ""Yes"" ".
Any form field name, from the cfform tag or an HTML form, that ends in one of the following
suffixes invokes server-side form validation:
• _integer Verifies that the user entered a number.
• _float Verifies that the user entered a number.
• _range Verifies that a numeric value entered is within specified boundaries.
• _date Verifies that the user entered a date; converts to ODBC date format.
• _time Verifies that the user correctly entered a time; converts to ODBC time format.
• _eurodate Verifies that the user entered a date in a standard European date format; converts
to ODBC date format.
Do not use these suffixes for your field names.
For more information, see Chapter 26, “Retrieving and Formatting Data,” in Developing
ColdFusion MX Applications.
Incorporating HTML form tags
The cfform tag lets you incorporate these standard HTML elements:
• Standard form tag attributes and values. The attributes and values are included in the form tag
that
cfform outputs in the page. For example, you can use form tag attributes like target
with cfform. Other pass-through attributes include CLASS, ENCTYPE, ID, ONLOAD,
ONRESET, and STYLE.