<cfinput>

Used inside cfform to place radio buttons, checkboxes, or text boxes. Provides input validation for the specified control type.

This tag cannot have a body.

This tag is also supported within <cfscript>

Attribute Description
onmouseover
string, optional

passed through to form tag created, only used for type html.

range
string, optional

Enter a minimum and maximum value range, separated by a comma. Valid only for numeric data.

border
string, optional

passed through to input tag created, only used for type html.

datasrc
string, optional

passed through to form tag created, only used for type html.

formaction
string, optional

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")

onmousemove
string, optional

passed through to form tag created, only used for type html.

maxlength
number, optional

The maximum length of text entered, if n type is Text.

list
string, optional

HTML attribute: Refers to a datalist containing predefined options for the input field

min
string, optional

HTML attribute: Specifies the input field's minimum value. Use together with the "max" attribute to create a range of legal values

tooltip
string, optional

Flash only: Text to display when the mouse pointer hovers over the control.

style
string, optional

passed through to form tag created, only used for type html.

autosuggest
string, optional

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".
passthrough
any, optional

HTML attributes that are not explicitly supported by cfinput. If you specify an attribute and value, they are passed to the HTML code generated for the cfinput tag.

onvalidate
string, optional

The name of a JavaScript function used to validate user input. The form object, input object, and input object value are passed to the specified routine, which should return true if validation succeeds and false otherwise. If used, the validate attribute is ignored.

bindonload
boolean, optional

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

width
string, optional

Applies to most Flash types, HTML image type on some browsers. The width of the control, in pixels. For Flash forms, Lucee ignores this attribute if you also specify a size attribute value.

autosuggestminlength
number, optional

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

dir
string, optional

passed through to form tag created, only used for type html.

accept
string, optional

passed through to input tag created, only used for type html.

alt
string, optional

passed through to input tag created, only used for type html.

mask
string, optional

A mask pattern that controls the character pattern that users can enter, or that the form sends to Lucee.

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.
onfocus
string, optional

passed through to form tag created, only used for type html.

class
string, optional

passed through to form tag created, only used for type html.

value
string, optional

An initial value for the form input element.

autocomplete
string, optional

HTML attribute: Specifies the types of files that can be submitted through a file upload (only for type="file")

checked
string, optional

Selects a control. No value is required. Applies if type=radio or checkbox. Default: false

tabindex
string, optional

passed through to form tag created, only used for type html.

formenctype
string, optional

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")

formnovalidate
string, optional

HTML attribute: Overrides the form's novalidate attribute. If present the input field should not be validated when submitted

onchange
string, optional

passed through to form tag created, only used for type html.

required
boolean, optional

Enter Yes or No. Default is No.

validateat
string, optional

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

monthnames
string, optional

A comma-delimited list of the month names that are displayed at the top of the calendar.

onselect
string, optional

passed through to form tag created, only used for type html.

placeholder
string, optional

HTML attribute: Specifies a hint to help users fill out the input field

size
string, optional

The size of the input control. Ignored if type is Radio or Checkbox.

formtarget
string, optional

HTML attribute: Overrides the form's target attribute. Specifies the target window used when the form is submitted (for type="submit" and type="image")

id
string, optional

passed through to form tag created, only used for type html.

onmouseout
string, optional

passed through to form tag created, only used for type html.

notab
string, optional

passed through to form tag created, only used for type html.

onkeypress
string, optional

passed through to form tag created, only used for type html.

title
string, optional

passed through to form tag created, only used for type html.

firstdayofweek
number, optional

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

readonly
string, optional

passed through to form tag created, only used for type html.

message
string, optional

Message text to appear if validation fails.

sourcefortooltip
string, optional

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.

multiple
string, optional

HTML attribute: If present the user is allowed more than one value

daynames
string, optional

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

align
string, optional

passed through to input tag created, only used for type html.

formmethod
string, optional

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")

form
string, optional

HTML attribute: Specifies one ore more forms the input field belongs to

datafld
string, optional

passed through to form tag created, only used for type html.

onbinderror
string, optional

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.

showautosuggestloadingicon
boolean, optional

A Boolean value that specifies whether to display an animated icon when loading an autosuggest value for a text input.

step
string, optional

HTML attribute: Specifies the legal number intervals for the input field

disabled
string, optional

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

ismap
string, optional

passed through to form tag created, only used for type html.

autosuggestbinddelay
number, optional

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"

onmousedown
string, optional

passed through to form tag created, only used for type html.

name
string, required

A name for the form input element.

bind
string, optional

A Flash bind expression that populates the field with information from other form fields.

label
string, optional

Label to put next to the control on a Flash or XML form. Not used for button, hidden, image, reset, or submit types.

accesskey
string, optional

passed through to input tag created, only used for type html.

delimiter
string, optional

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.

onclick
string, optional

passed through to form tag created, only used for type html.

src
string, optional

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.

max
string, optional

HTML attribute: Specifies the input field's maximum value. Use together with the "min" attribute to create a range of legal values

autofocus
string, optional

Specifies that the input field should have focus on page load (not for type="hidden")

height
string, optional

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.

onerror
string, optional

The name of a JavaScript function you want to execute in the event of a failed validation.

enabled
string, optional

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

pattern
string, optional

The JavaScript regular expression pattern to use to validate the input. Required only if you specify validate = "regular_expression".

onmouseup
string, optional

passed through to form tag created, only used for type html.

onkeydown
string, optional

passed through to form tag created, only used for type html.

typeahead
boolean, optional

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

dataformatas
string, optional

passed through to form tag created, only used for type html.

visible
string, optional

Flash only: Boolean value specifying whether to show the control. Space that would be occupied by an invisible control is blank. Default: true

maxresultsdisplayed
number, optional

The maximum number suggestions to display in the autosuggest list. Valid only for cfinput type="text".

bindattribute
string, optional

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 Lucee-specific attributes. Ignored if there is no bind attribute. Valid only for cfinput type="text".

lang
string, optional

passed through to form tag created, only used for type html.

onblur
string, optional

passed through to form tag created, only used for type html.

type
string, optional

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.
hspace
string, optional

passed through to form tag created, only used for type html.

onkeyup
string, optional

passed through to form tag created, only used for type html.

usemap
string, optional

passed through to form tag created, only used for type html.

validate
string, optional

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.

ondblclick
string, optional

passed through to form tag created, only used for type html.

<cfinput
    [onmouseover=string]
    [range=string]
    [border=string]
    [datasrc=string]
    [formaction=string]
    [onmousemove=string]
    [maxlength=number]
    [list=string]
    [min=string]
    [tooltip=string]
    [style=string]
    [autosuggest=string]
    [passthrough=any]
    [onvalidate=string]
    [bindonload=boolean]
    [width=string]
    [autosuggestminlength=number]
    [dir=string]
    [accept=string]
    [alt=string]
    [mask=string]
    [onfocus=string]
    [class=string]
    [value=string]
    [autocomplete=string]
    [checked=string]
    [tabindex=string]
    [formenctype=string]
    [formnovalidate=string]
    [onchange=string]
    [required=boolean]
    [validateat=string]
    [monthnames=string]
    [onselect=string]
    [placeholder=string]
    [size=string]
    [formtarget=string]
    [id=string]
    [onmouseout=string]
    [notab=string]
    [onkeypress=string]
    [title=string]
    [firstdayofweek=number]
    [readonly=string]
    [message=string]
    [sourcefortooltip=string]
    [multiple=string]
    [daynames=string]
    [align=string]
    [formmethod=string]
    [form=string]
    [datafld=string]
    [onbinderror=string]
    [showautosuggestloadingicon=boolean]
    [step=string]
    [disabled=string]
    [ismap=string]
    [autosuggestbinddelay=number]
    [onmousedown=string]
    name=string
    [bind=string]
    [label=string]
    [accesskey=string]
    [delimiter=string]
    [onclick=string]
    [src=string]
    [max=string]
    [autofocus=string]
    [height=string]
    [onerror=string]
    [enabled=string]
    [pattern=string]
    [onmouseup=string]
    [onkeydown=string]
    [typeahead=boolean]
    [dataformatas=string]
    [visible=string]
    [maxresultsdisplayed=number]
    [bindattribute=string]
    [lang=string]
    [onblur=string]
    [type=string]
    [hspace=string]
    [onkeyup=string]
    [usemap=string]
    [validate=string]
    [ondblclick=string]
>

Examples

There are currently no examples for this tag.

See also