Developing a search capability
73
Completing the Trip Search Results page
In the following exercises you will test and modify tripsearchresults.cfm. In the first exercise, you
will test the Trip Search Results page by entering criteria on the Trip Search form and inspecting
the results. In the second exercise, you will finish the code to construct the complete WHERE
clause for all three queryable columns from the Trip Search form.
Exercise: testing the Trip Search Results page
Follow these steps to test the Trip Search Results page:
1
Copy the tripsearch.cfm and tripsearchresult.cfm files from the solutions directory to the
my_app directory.
2
View the tripsearch.cfm from the my_app directory in your browser and do the following:
a
In the Trip Location drop-down list box select the Begins With option,
and enter the value
C
in the text box.
b
Click Search.
The Trip Results page displays several entries, as follows:
c
Notice in the Trip Results page that only one trip has a trip location of China.
d
Click the Back button in your browser to return to the Trip Search page.
3
In the Trip Location drop-down list box of the Trip Search page, select the Is option, enter the
value China, then click Search.
The Trip Results page displays only one entry for the trip to China in the HTML table.
4
Verify that the other criteria (departure date and price) are not taken into consideration yet as
follows:
a
Click the Back button in the browser to return to the Trip Search page.
b
In the Departure Date drop-down list box, select Before, enter 1/1/1900
as the date, and
select Smaller Than 0
for the price
.
Obviously, either of these conditions would produce a results page with no rows.
c
Click the Search button.
The Search Result page should be identical to step 3 because the code to build the WHERE
clause in the Trip Results page does not include departure date and price.
Summary of Contents for COLDFUSION MX 61-GETTING STARTED BUILDING COLDFUSION...
Page 1: ...Getting Started Building ColdFusion MX Applications...
Page 6: ...6 Contents...
Page 10: ......
Page 30: ...30 Chapter 2 CFML Basics...
Page 36: ...36 Chapter 3 Database Fundamentals...
Page 48: ......
Page 76: ...76 Chapter 6 Lesson 2 Writing Your First ColdFusion Application...
Page 134: ...134 Index...