190
VALUE
Optional. The query column value for the list element. Used with the QUERY
attribute.
DISPLAY
Optional. The query column displayed. Defaults to the value of VALUE. Used with
the QUERY attribute.
PASSTHROUGH
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. See the Usage section for
more information about specifying values.
Usage
You can add standard and dynamic HTML FORM tag attributes and their values to the
CFSELECT tag by using the PASSTHROUGH attribute. These attributes and values are
passed directly through ColdFusion to the browser in creating a form.
If you specify a value in quotation marks, you must escape the quotation marks by
doubling them, for example,
PASSTHROUGH= "readonly= " "YES " " "
CFSELECT supports the JavaScript onClick event in the same manner as the HTML
INPUT tag:
<CFSELECT NAME="dept"
MESSAGE="You must select a department name"
QUERY="get_dept_list"
VALUE="dept_name"
onClick="JavaScript_function">
Example
<!--- This example shows the use of CFTREE, CFSELECT and CFGRID in a
CFFORM. The query takes a list of employees, and uses CFTREE and CFSELECT
to display the results of the query.
to show an alternate means of displaying the same data --->
<!--- set a default for the employeeNames variable --->
<CFPARAM NAME="employeeNames" DEFAULT="">
<!--- if an employee name has been passed from the form,
set employeeNames variable to this value --->
<CFIF IsDefined("form.employeeNames") is not "False">
<CFSET employeeNames = form.employeeNames>
</CFIF>
<!--- query the datasource to find the employee information--->
<CFQUERY NAME="GetEmployees" DATASOURCE="cfsnippets">
SELECT
FROM
</CFQUERY>
Emp_ID, FirstName, LastName, EMail, Phone, Department
Employees where lastname
<CFIF #employeeNames# is not "">= '#employeeNames#'</CFIF>
CFML Language Reference
In addition, CFGRID is used
Need help?
Do you have a question about the COLDFUSION 4.5-CFML LANGUAGE and is the answer not in the manual?
Questions and answers