O'Reilly logo

Programming ColdFusion MX, 2nd Edition by Rob Brooks-Bilson

Stay ahead with the world's most comprehensive technology and business learning platform.

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, tutorials, and more.

Start Free Trial

No credit card required

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. ...

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, interactive tutorials, and more.

Start Free Trial

No credit card required