Name

cfinput

Synopsis

<cfform>
  <cfinput>
  ...
</cfform>

Creates text and password input controls, as well as checkboxes and radio buttons, within a cfform.

New in ColdFusion MX, if the preservedata attribute of the cfform tag is set to Yes, radio button and checkbox types are checked provided the value of the control matches the value of the posted data.

Attributes

name=" name "

The form-field name for the input control. Required.

checked="Yes|No"

Whether or not a checkbox or radio button input control should be checked. Optional. The default is No.

maxlength=" integer "

The maximum number of characters to accept for a Password or Text input control. Optional.

message=" validation_message "

Text to appear if validation fails. Optional.

onerror=" function_name "

The name of a JavaScript function that should be executed if validation fails for any reason. Optional.

onvalidate=" javascript_function"

A JavaScript validation function that should be executed before the form is submitted. Specifying a value for onvalidate overrides any values set in the validate attribute. Optional.

passthrough=" HTML_attribute "

Any additional HTML attributes you need to pass that aren’t directly supported by the cfinput tag. Optional.

pattern=" javascript_regular_expression "

JavaScript regular expression that matches form input when validate is Regular_Expression. pattern may contain ColdFusion variables and expressions as they are evaluated prior to the execution of the regular expression. Optional. ...

Get Programming ColdFusion MX, 2nd Edition now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.