Programming instructions
Developing a search capability 71
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>