Programming instructions

102 Lesson 4 Validating Data to Enforce Business Rules
3 Save the file as tripedit.cfm to the my_app directory.
4 View the tripedit.cfm in a browser and test the form by entering a trip name in the
Trip Name field then clicking Save. An error occurs.
5 View the form source (tripedit.cfm) in an editor to try to determine the cause of the
error. Notice that the
<form> tag on line 6 of the source code has an action
attribute. This attribute indicates the page to receive the form values posted by the
tripedit.cfm page. Since the page, tripeditaction.cfm, does not exist yet, the
ColdFusion Server sends an error.
At this point, this form has little value since it does not store any information in the
database and does not enforce any business rules of Compass Travel. In the next exercise,
you will develop the action page to enforce the business rules.
Table You can format a data entry form and display its controls neatly, by using
the table tag, table, table row tag, tr, and the table data tag, td.
Form
Controls
The form requires controls to collect and submit user input. There are a
variety of types of form controls you can use. For this lesson, you will use
the following controls:
<input>. Accepts text answers such as Trip Name and Trip Price.
<input type=checkbox>. Asks yes or no questions, such as Deposit
Required?
<select>,<option>. Provides user with a list of possible answers such as
the event type (Mountain Biking, Surfing, and so on).
<textarea>. Gathers user input on multiple lines such as for the Trip
Description.
<input type=submit>. Posts the information collected to the server.
Tag Description