Lucee Tag Reference

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

Body

This tag must have a body.

Example

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

Attributes

The attributes for this tag are fixed. Except for the following attributes no other attributes are allowed.
Name Type Required Description
casesensitive boolean No is compare for selected case sensitive or not 
class string No passed through to form tag created, only used for type html. 
datafld string No passed through to form tag created, only used for type html. 
dataformatas string No passed through to form tag created, only used for type html. 
datasrc string No passed through to form tag created, only used for type html. 
dir string No passed through to form tag created, only used for type html. 
disabled string No passed through to form tag created, only used for type html. 
display string No The query column displayed. Defaults to the value of value. Used with the query attribute. 
editable boolean No Boolean value specifying whether you can edit the
contents of the control. 
enabled boolean No Flash only: Boolean value specifying whether to show the control.
Space that would be occupied by an invisible control is
blank.
Default: true 
group string No Query column to use to group the items in the drop-down
list into a two-level hierarchical list. 
height number No The height of the control, in pixels. 
id string No ID for form input element. 
label string No Label to put next to the control on a Flash or XML-format form. 
lang string No passed through to form tag created, only used for type html. 
message string No Message that displays if required = 'Yes' and no selection is made. 
multiple string No Yes or No. Yes permits selection of multiple elements in the drop-down list box. The default
is No. 
name string Yes Name of the form you are creating. 
onblur string No  
onchange string No JavaScript to run
when the control changes due to user action. 
onclick string No JavaScript to run when the user clicks the control. 
ondblclick string No passed through to form tag created, only used for type html. 
onerror string No The name of a valid JavaScript function to execute in the event of a failed validation. 
onfocus string No passed through to form tag created, only used for type html. 
onkeydown string No JavaScript to run when the user depresses a keyboard
key in the control. 
onkeypress string No passed through to form tag created, only used for type html. 
onkeyup string No JavaScript to run
when the user releases a keyboard key in the control. 
onmousedown string No JavaScript to run
when the user releases a mouse button in the control. 
onmousemove string No passed through to form tag created, only used for type html. 
onmouseout string No passed through to form tag created, only used for type html. 
onmouseover string No passed through to form tag created, only used for type html. 
onmouseup string No JavaScript to run
when the user presses a mouse button in the control. 
passthrough any No 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. 
query string No Name of the query to be used to populate the drop-down list box. 
queryposition string No 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 
required boolean No 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. 
selected string No A value matching at least one entry in value to preselect the entry in the drop-down list box. 
size number No Number of entries in the drop-down list. 
style string No Lucee passes the
style attribute to the browser. 
tabindex string No passed through to form tag created, only used for type html. 
title string No passed through to form tag created, only used for type html. 
tooltip string No Flash only: Text to display when the mouse pointer hovers over the control. 
value string No The query column value for the list element. Used with the query attribute. 
visible boolean No Flash only: Boolean value specifying whether to show the control.
Space that would be occupied by an invisible control is
blank.
Default: true 
width number No The width of the control, in pixels.