cfinput

Overview ColdFusion Open BlueDragon Lucee

Used within the cfform tag, to place radio buttons, check boxes, or text boxes on a form. Provides input validation for the specified control type.

Attributes

Name Required Type Default Description
accept No
accesskey No
align No
alt No
3
autocomplete No HTML attribute: Specifies the types of files that can be submitted through a file upload (only for type="file")
3
autofocus No Specifies that the input field should have focus on page load (not for type="hidden")
8
3
autosuggest No String Specifies entry completion suggestions to display as the user types into a text input. The user can select a suggestion to complete the text entry. The valid value can be either of the following: • A string consisting of the suggestion values separated by the delimiter specified by the delimiter attribute. • A bind expression that gets the suggestion values based on the current input text. Valid only for cfinput type="text".
8
3
autosuggestbinddelay No Numeric The minimum time between autosuggest bind expression invocations, in seconds. Use this attribute to limit the number of requests that are sent to the server when a user types. Valid only for cfinput type="text"
8
3
autosuggestminlength No Numeric The minimum number of characters required in the text box before invoking a bind expression to return items for suggestion. Valid only for cfinput type="text".
bind No String A Flash bind expression that populates the field with information from other form fields.
8
3
bindattribute No String Specifies the HTML tag attribute whose value is set by the bind attribute. You can only specify attributes in the browser’s HTML DOM tree, not ColdFusion-specific attributes. Ignored if there is no bind attribute. Valid only for cfinput type="text".
8
3
bindonload No Boolean false A Boolean value that specifies whether to execute the bind attribute expression when first loading the form. Ignored if there is no bind attribute. Valid only for cfinput type="text".
border No
checked No Boolean false Selects a control. No value is required. Applies if type=radio or checkbox. Default: false
class No String Stylesheet class for form input element.
datafld No
dataformatas No
datasrc No
daynames No String A comma-delimited list that sets the names of the weekdays displayed in the calendar. Sunday is the first day and the rest of the weekday names follow in the normal order. Default is: S,M,T,W,Th,F,S
8
3
delimiter No String The delimiter to use to separate entries in a static autosuggest list. This attribute is meaningful only if the autosuggest attribute is a string of delimited values.
dir No
disabled No Boolean false Disables user input, making the control read-only. To disable input, specify disabled without an attribute or disabled="true". To enable input, omit the attribute or specify disabled="false".
enabled No Boolean true Flash only: Boolean value specifying whether the control is enabled. A disabled control appears in light gray. The inverse of the disabled attribute. Flash only. Default: true
firstdayofweek No Numeric 0 Integer in the range 0-6 specifying the first day of the week in the calendar, 0 indicates Sunday, 6 indicates Saturday. Default is: 0
3
form No HTML attribute: Specifies one ore more forms the input field belongs to
3
formaction No HTML attribute: Overrides the form's action attribute. Must be a valid URL that defines where to send the data when the form is submitted (for type="submit" and type="image")
3
formenctype No HTML attribute: Overrides the form's enctype attribute. Specifies how form-data should be encoded before sending it to the server (for type="submit" and type="image")
3
formmethod No HTML attribute: Overrides the form's method attribute. Defines the HTTP method for sending data to the action URL (for type="submit" and type="image")
3
formnovalidate No HTML attribute: Overrides the form's novalidate attribute. If present the input field should not be validated when submitted
3
formtarget No HTML attribute: Overrides the form's target attribute. Specifies the target window used when the form is submitted (for type="submit" and type="image")
height No Numeric Applies to most Flash types, HTML image type on some browsers. The height of the control, in pixels. The displayed height might be less than the specified size.
hspace No
id No String ID for form input element.
ismap No
label No String Label to put next to the control on a Flash or XML form. Not used for button, hidden, image, reset, or submit types.
lang No
3
list No HTML attribute: Refers to a datalist containing predefined options for the input field
mask No String A mask pattern that controls the character pattern that users can enter, or that the form sends to ColdFusion. In HTML and Flash for type=text use: - A = [A-Za-z] - X = [A-Za-z0-9] - 9 = [0-9] - ? = Any character - all other = the literal character In Flash for type=datefield use: - D = day; can use 0-2 mask characters. - M = month; can use 0-4 mask characters. - Y = year; can use 0, 2, or 4 characters. - E = day in week; can use 0-4 characters.
9
matchContains No Boolean false true, match returned "contains" the query string. Default is false so that only results that "start with" the query string are returned.
3
max No HTML attribute: Specifies the input field's maximum value. Use together with the "min" attribute to create a range of legal values
maxlength No Numeric Maximum length of text entered, if type=text or password.
8
3
maxresultsdisplayed No Numeric The maximum number suggestions to display in the autosuggest list.Valid only for cfinput type="text".
message No String Message text to display if validation fails
3
min No HTML attribute: Specifies the input field's minimum value. Use together with the "max" attribute to create a range of legal values
monthnames No String A comma-delimited list of the month names that are displayed at the top of the calendar.
3
multiple No HTML attribute: If present the user is allowed more than one value
name Yes String Name for form input element.
notab No
8
3
onbinderror No String The name of a JavaScript function to execute if evaluating a bind expression, including an autosuggest bind expression, results in an error. The function must take two attributes: an HTTP status code and a message.
onblur No the html attribute onBlur
onchange No String JavaScript (HTML/XML) or ActionScript (Flash) to run when the control changes due to user action. In Flash, applies to datefield, password, and text types only.
onclick No String JavaScript (HTML/XML) or ActionScript (Flash) to run when the user clicks the control. In Flash, applies to button, checkbox, image, radio, reset, and submit types only.
ondblclick No the html attribute onDblclick
onerror No String Custom JavaScript function to execute if validation fails.
onfocus No the html attribute onFocus
onkeydown No String JavaScript (HTML/XML) or ActionScript (Flash) ActionScript to run when the user presses a keyboard key in the control.
onkeypress No the html attribute onKeyPress
onkeyup No String JavaScript (HTML/XML) or ActionScript (Flash) to run when the user releases a keyboard key in the control.
onmousedown No String JavaScript (HTML/XML) or ActionScript (Flash) to run when the user releases a mouse button in the control.
onmousemove No the html attribute onMouseMove
onmouseout No the html attribute onMouseOut
onmouseover No the html attribute onMouseOver
onmouseup No String JavaScript (HTML/XML) or ActionScript (Flash) to run when the user presses a mouse button in the control.
onselect No the html attribute onselect
onvalidate No String 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.
passthrough No String This attribute is deprecated. Passes arbitrary attribute-value pairs to the HTML code that is generated for the tag. You can use either of the following formats: passthrough="title=""myTitle""" passthrough='title="mytitle"'
pattern No Regex JavaScript regular expression pattern to validate input. ColdFusion uses this attribute only if you specify regex in the validate attribute. Omit leading and trailing slashes.
3
placeholder No HTML attribute: Specifies a hint to help users fill out the input field
range No String Minimum and maximum value range, separated by a comma. If type = "text" or "password", this applies only to numeric data.
readonly No
required No Boolean false * yes: the field must contain data. * no: allows an empty field.
8
3
showautosuggestloadingicon No Boolean true A Boolean value that specifies whether to display an animated icon when loading an autosuggest value for a text input.
size No Numeric Size of input control. Ignored, if type=radio or checkbox. If specified in a Flash form, ColdFusion sets the control width pixel value to 10 times the specified size and ignores the width attribute.
8
3
sourcefortooltip No String The URL of a page to display as a tool tip. The page can include HTML markup to control the format, and the tip can include images.If you specify this attribute, an animated icon appears with the text "Loading..." while the tip is being loaded.
src No String Applies to Flash button, reset, submit, and image types, and the HTML image type. URL of an image to use on the button. Flash does not support GIF images.
3
step No HTML attribute: Specifies the legal number intervals for the input field
style No String In HTML or XML format, ColdFusion passes the style attribute to the browser or XML. In Flash format, must be a style specification in CSS format.
tabindex No the html attribute tabIndex
title No
tooltip No String Flash only: Text to display when the mouse pointer hovers over the control.
type No String text The input control type to create: - button: push button. - checkbox: check box. - file: file selector; not supported in Flash. - hidden: invisible control. - image: clickable button with an image. - password: password entry control; hides input values. - radio: radio button. - reset: form reset button. - submit: form submission button. - text: text entry box. - datefield: Flash only; date entry field with an expanding calendar for selecting dates.
8
3
typeahead No Boolean false A Boolean value that specifies whether the autosuggest feature should automatically complete a user's entry with the first result in the suggestion list.Valid only for cfinput type="text".
usemap No
validate No String date: verifies format mm/dd/yy. eurodate: verifies date format dd/mm/yyyy. time: verifies time format hh:mm:ss. float: verifies floating point format. integer: verifies integer format. telephone: verifies telephone format ###-###-####. The separator can be a blank. Area code and exchange must begin with digit 1 - 9. zipcode: verifies, in U.S. formats only, 5- or 9-digit format #####-####. The separator can be a blank. creditcard: strips blanks and dashes; verifies number using mod10 algorithm. Number must have 13-16 digits. social_security_number: verifies format ###-##-####. The separator can be a blank. regular_expression: matches input against pattern attribute.
validateat No String onSubmit How to do the validation; one or more of the following: onSubmit, onServer or onBlur. onBlur and onSubmit are identical in Flash forms. For multiple values, use a comma-delimited list. Default: onSubmit
value No String HTML: corresponds to the HTML value attribute. Its use depends on control type. Flash: optional; specifies text for button type inputs: button, submit, and image.
visible No Boolean true Flash only: Boolean value specifying whether to show the control. Space that would be occupied by an invisible control is blank. Default: true
width No Numeric Applies to most Flash types, HTML image type on some browsers. The width of the control, in pixels. For Flash forms, ColdFusion ignores this attribute if you also specify a size attribute value.