User Guide

cfselect 313
In addition to the listed attributes, you can use the following HTML attributes in the cfform tag
without using the
passThrough attribute. The tag does not use these attributes, but includes
them in the HTML of the
form tag that it generates and returns to the browser:
class
id
onBlur
onChange
onClick
onDblclick
onFocus
style
tabIndex
Usage
To ensure that a selected list box item persists across postbacks, use the cfform preserveData
attribute with a list generated from a query.
(This strategy works only with data that is populated
from a query.)
If the
cfform preserveData attribute is true and the form posts back to the same page, and if
the control is populated by a query, the posted selection(s) for the
cfselect control are used
instead of the
Selected attribute. For controls that are populated with regular HTML option
tags, the developer must dynamically add the
Selected attribute to the appropriate option tag(s).
For this tag to work properly. the browser must be JavaScript-enabled.
To add other HTML <input> tag attributes and values to this tag, use the
passThrough attribute.
They are passed through to the
select tag that ColdFusion generates for the cfselect control
when creating a form. The supported HTML attributes are: CLASS, ID, MAXLENGTH,
MESSAGE, ONBLUR, ONCHANGE, ONCLICK, ONDBLCLICK, ONFOCUS, SIZE,
STYLE, and TABINDEX.
If you put a value in quotation marks, you must escape them; for example:
passThrough = "readonly = " "yes " " "
For more information, see the cfform tag entry.
This tag requires an end tag.
value Optional Query column to use for the value of each list element. Used
with
query attribute.
display Optional Value of
value
attribute
Query column to use for the display label of each list element.
Used with
query attribute.
passThrough Optional Passes one or more arbitrary attribute-value pairs to the HTML
code that is generated for the tag. You can use either of the
following formats to include the quotation marks around the
attribute value:
passthrough="ID=""myID"""
passthrough=’ID="myID"’
The second format, which surrounds all the attribute-value
pairs to be passed through in single quotation marks is clearer,
particularly when you pass multiple HTML attributes.
Attribute Req/Opt Default Description