</select>
</td>
<td>
<input type="text" name="departureValue">
</td>
</tr>
<!--- Field: price --->
<tr>
<td>Price
</td>
<td>
<select name="priceOperator">
<option value="EQUALS">is
<option value="GREATER">greater than
<option value="SMALLER">smaller than
</select>
</td>
<td>
<input type="text" name="priceValue">
</td>
</tr>
</table>
<p>
<input type="submit" value="Search">
</form>
</body>
</html>
Reviewing the code
The following table describes the search criteria code and its function:
Code
<form action="tripsearchresult.cfm"
method="post">
<select name="tripLocationOperator">
<option value="EQUALS">is
<option value="BEGINS_WITH">begins with
</select>
<input type="text" name="tripLocationValue">
Building the Search Results page
Based on the queryable columns identified earlier, the SQL query to display the search results
would look like this:
SELECT tripName,
FROM trips
The purpose of the Trip Search form is to supply the data needed to build the WHERE clause to
finish this SQL SELECT statement and constrain the query according to the user's input.
tripLocation, departureDate, returnDate, price, tripID
Explanation
Identifies tripsearchresult.cfm as the search
action page. Results of user entry are passed
to the search action page.
Builds a drop-down list offering the query
operators for tripLocation. There must one
operator list box for each queryable column.
Input text control to capture value to test.
There is one text control for each queryable
column.
Developing a search capability
69
Need help?
Do you have a question about the COLDFUSION MX 61-GETTING STARTED BUILDING COLDFUSION MX and is the answer not in the manual?
Questions and answers