<cfselect>

Used inside cfform, cfselect lets you construct a drop-down list box form control. You can populate the drop-down list box from a query, or using the option tag. Use option elements to populate lists. The syntax for the option tag is the same as for its HTML counterpart.

Usage

<cfselect
    [onmouseover=string]
    [query=string]
    [message=string]
    [queryposition=string]
    [multiple=string]
    [datasrc=string]
    [onmousemove=string]
    [tooltip=string]
    [style=string]
    [datafld=string]
    [display=string]
    [casesensitive=boolean]
    [passthrough=any]
    [disabled=string]
    [width=number]
    [onmousedown=string]
    [dir=string]
    name=string
    [onfocus=string]
    [class=string]
    [value=string]
    [label=string]
    [onclick=string]
    [tabindex=string]
    [height=number]
    [selected=string]
    [onchange=string]
    [required=boolean]
    [onerror=string]
    [enabled=boolean]
    [onmouseup=string]
    [onkeydown=string]
    [dataformatas=string]
    [visible=boolean]
    [size=number]
    [lang=string]
    [onblur=string]
    [id=string]
    [onmouseout=string]
    [onkeyup=string]
    [onkeypress=string]
    [editable=boolean]
    [title=string]
    [group=string]
    [ondblclick=string]
><!--- body ---></cfselect>

This tag must have a body.

This tag is also supported within cfscript

Attributes

Attribute Description
onmouseover
(string, optional)

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

query
(string, optional)

Name of the query to be used to populate the drop-down list box.

message
(string, optional)

Message that displays if required = 'Yes' and no selection is made.

queryposition
(string, optional)

If you populate the options list with a query and use HTML option child tags to specify additional entries, determines the location of the items from the query relative to the items from the option tags: - above: Put the query items above the options items. - below: Put the query items below the options items. Default: above

multiple
(string, optional)
datasrc
(string, optional)

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

onmousemove
(string, optional)

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

tooltip
(string, optional)

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

style
(string, optional)

Lucee passes the style attribute to the browser.

datafld
(string, optional)

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

display
(string, optional)

The query column displayed. Defaults to the value of value. Used with the query attribute.

casesensitive
(boolean, optional)

is compare for selected case sensitive or not

passthrough
(any, optional)

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

disabled
(string, optional)

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

width
(number, optional)

The width of the control, in pixels.

onmousedown
(string, optional)

JavaScript to run when the user releases a mouse button in the control.

dir
(string, optional)

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

name
(string, required)

Name of the form you are creating.

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)

The query column value for the list element. Used with the query attribute.

label
(string, optional)

Label to put next to the control on a Flash or XML-format form.

onclick
(string, optional)

JavaScript to run when the user clicks the control.

tabindex
(string, optional)

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

height
(number, optional)

The height of the control, in pixels.

selected
(string, optional)

A value matching at least one entry in value to preselect the entry in the drop-down list box.

onchange
(string, optional)

JavaScript to run when the control changes due to user action.

required
(boolean, optional)

Yes or No. If Yes, a list element must be selected when the form is submitted, and the size of the drop-down list must be at least two. Default is No.

onerror
(string, optional)

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

enabled
(boolean, optional)

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

onmouseup
(string, optional)

JavaScript to run when the user presses a mouse button in the control.

onkeydown
(string, optional)

JavaScript to run when the user depresses a keyboard key in the control.

dataformatas
(string, optional)

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

visible
(boolean, optional)

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

size
(number, optional)

Number of entries in the drop-down list.

lang
(string, optional)

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

onblur
(string, optional)
id
(string, optional)

ID for form input element.

onmouseout
(string, optional)

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

onkeyup
(string, optional)

JavaScript to run when the user releases a keyboard key in the control.

onkeypress
(string, optional)

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

editable
(boolean, optional)

Boolean value specifying whether you can edit the contents of the control.

title
(string, optional)

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

group
(string, optional)

Query column to use to group the items in the drop-down list into a two-level hierarchical list.

ondblclick
(string, optional)

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

Examples

There are currently no examples for this tag.