MACROMEDIA COLDFUSION 5-DEVELOPING Develop Manual page 107

Table of Contents

Advertisement

Creating Dynamic Check Boxes and Multiple-Selection List Boxes
Searching string values
Suppose you want the user to select departments from a multiple selection list box.
The database search field is a string field. The query retrieves detailed information
on the selected department(s):
<select name="SelectDepts" multiple>
</select>
If the user selects the Marketing and Sales items, the SelectDepts form field value is
Marketing,Sales.
Just as you did when using check boxes to search database fields containing string
values, use the ColdFusion
SELECT *
The following statement gets sent to the database:
SELECT *
<option value="Training">Training
<option value="Marketing">Marketing
<option value="HR">HR
<option value="Sales">Sales
FROM Departmt
WHERE Dept_Name IN (#ListQualify(Form.SelectDepts,"'")#)
FROM Departmt
WHERE Dept_Name IN ('Marketing','Sales')
function with multiple-selection list boxes:
ListQualify
87

Advertisement

Table of Contents
loading

This manual is also suitable for:

Coldfusion 5

Table of Contents