Using SQL operators to create a search criteria page
A simple design for a search criteria page presents an operator list and data entry field for each of
the queryable columns. Following this pattern, a page to collect the Compass Travel Trip search
criteria looks like this:
Since all the code used to produce the search criteria page is HTML, you are not requested to
build this page. You will, however, use this page (tripsearch.cfm) later in this lesson to test the
search action page. The source code for the Trip Search form (tripsearch.cfm) is as follows:
<html>
<head>
<title>Trip Maintenance - Search Form</title>
</head>
<body>
<img src="images/tripsearch.gif">
<!--- Search form --->
<form action="tripsearchresult.cfm" method="post">
<table>
<!--- Field: tripLocation --->
<tr>
<td>Trip Location
</td>
<td>
<select name="tripLocationOperator">
<option value="EQUALS">is
<option value="BEGINS_WITH">begins with
</select>
</td>
<td>
<input type="text" name="tripLocationValue">
</td>
</tr>
<!--- Field: departureDate --->
<tr>
<td>Departure Date
</td>
<td>
<select name="departureOperator">
<option value="EQUALS">is
<option value="BEFORE">before
<option value="AFTER">after
68
Chapter 6: Lesson 2: Writing Your First ColdFusion Application
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