<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.
This tag must have a body.
This tag is also supported within <cfscript>
Requires Extension: Form Tags
<cfselect
datafld=string
casesensitive=boolean
datasrc=string
dataformatas=string
disabled=string
multiple=string
title=string
dir=string
lang=string
onmousedown=string
onmouseup=string
onmouseover=string
onmousemove=string
onmouseout=string
onkeypress=string
onkeyup=string
onkeydown=string
name=string
size=number
required=boolean
message=string
onerror=string
query=string
selected=string
value=string
display=string
passthrough=any
class=string
id=string
onblur=string
onchange=string
onclick=string
ondblclick=string
onfocus=string
style=string
tabindex=string
label=string
enabled=boolean
group=string
height=number
queryposition=string
tooltip=string
visible=boolean
width=number
editable=boolean
><!--- body ---></cfselect>
Unimplemented Attribute(s)
Examples
<cfform name="mycfform">
-- year --
<br />
<cfselect name="year" enabled=true style="color:blue;" size=2>
<option name="0" selected=true>--2024--</option>
<option name="1">--2023--</option>
<option name="3">--2022--</option>
<option name="2">--2021--</option>
</cfselect> <br />
-- color --
<br />
<cfselect name="color" >
<option name="0">--red--</option>
<option name="1">--green--</option>
<option name="2">--blue--</option>
</cfselect>
</cfform>
See also
- Ajax features
- <cfform>
- Search Issue Tracker
- Search Lucee Test Cases (good for further, detailed examples)