System information
Exercise 1: Creating the main application page from the Trip Detail page 99
To add navigation buttons to the Trip Detail page:
1.
Open the tripdetail.cfm file in the my_app directory.
2.
Insert the following code between the </table> and </cfoutput> tags:
<form action="navigationaction.cfm" method="post">
<input type="hidden" name="RecordID" value="#tripID#">
<!--- graphical navigation buttons --->
<input type="image" name="btnFirst" src="images/first.gif">
<input type="image" name="btnPrev" src="images/prev.gif">
<input type="image" name="btnNext" src="images/next.gif">
<input type="image" name="btnLast" src="images/last.gif">
</form>
Note: The current trip record ID (
tripID) is in a hidden field in the form code. This field provides the
action page with current record ID that it must have in order to build the query to access the
appropriate record in the Trips database table.
3.
Save the file.
To test the updated application:
1.
View the updated tripdetail.cfm page in a browser.
The Trip Search Results page appears:
2.
Test the buttons by clicking any navigation button.
An error occurs because the navigation action page (navigationaction.cfm) does not exist. The
navigation action page processes the navigation button requests. You will build the navigation
action page in “Lesson 7: Validating Data to Enforce Business Rules” on page 103.