Exercise 5: Linking the Trip Edit page to the main page

As discussed in Lesson 7: Validating Data to Enforce Business Rules, the action page for the maintenance buttons on the main page is maintenanceaction.cfm. You previously added code for the Search and Delete buttons. In this exercise, you add code for the Add and Edit buttons.

To link the Add and Edit buttons on the Trip Detail page:

  1. Open the maintenanceaction.cfm file in the my_app directory in your editor.
  2. Locate the </cfif> tag at the end of the file.
  3. Insert the highlighted code:
    	<cfelseif IsDefined("Form.btnEdit")>
    	<!--- Code to execute if the user clicked Edit. --->
    		<cflocation url="tripedit.cfm?ID=#Form.RecordID#">
    	<cfelseif IsDefined("Form.btnAdd")>
    	<!--- Code to execute if the user clicked Add. --->
    		<cflocation url="tripedit.cfm">
    
  4. Save the file.

ColdFusion 9 | ColdFusion 8 | ColdFusion MX 7 | ColdFusion MX 6.1 | ColdFusion MX | Forums | Developer Center | KnowledgeBase | Bug Reporting

Version 7

 

Send me an e-mail when comments are added to this page | Comment Report

Current page: http://livedocs.adobe.com/coldfusion/7/htmldocs/00000177.htm