44
Chapter 4 Retrieving and Formatting Data
Form notes and considerations
•
To make the coding process easy to follow, name form controls the same as
target database fields.
•
For ease of use, limit radio buttons to between three and five mutually exclusive
options. If you need more options, consider a drop-down select list.
•
Use list boxes to allow the user to choose from many options or to chose multiple
items from a list.
•
All the data that you collect on a form is automatically passed as form variables to
the associated action page.
•
Check boxes and radio buttons do not pass to action pages unless they are
selected on a form. If you try to reference these variables on the action page, you
receive an error if they are not present.
•
You can dynamically populate drop-down select lists using query data. See
“Dynamically Populating List Boxes” on page 82 for details.
<select name="City">
<option value="Arlington">
Arlington
<option value="Boston">Boston
<option value="Cambridge">
Cambridge
<option value="Minneapolis">
Minneapolis
<option value="Seattle">Seattle
</select>
Create a drop-down list box named City
and populate it with the values
“Arlington,” “Boston,” “Cambridge,”
“Minneapolis,” and “Seattle.”
<input type="checkbox" name=
"Contractor" value="Yes|No"
checked>Yes
Create a check box that allows users to
specify whether they want to list
employees who are contractors. Make
the box selected by default.
<input type="Reset"
name="ResetForm" value="Clear
Form">
Create a reset button to allow users to
clear the form. Put the text Clear Form on
the button.
<input type="Submit"
name="SubmitForm" value="Submit">
Create a submit button to send the values
that users enter to the action page for
processing. Put the text Submit on the
button.
Code
Description
Summary of Contents for COLDFUSION 5-DEVELOPING
Page 1: ...Macromedia Incorporated Developing ColdFusion Applications MacroMedia ColdFusion 5 ...
Page 58: ...38 Chapter 3 Querying a Database ...
Page 134: ...114 Chapter 7 Updating Your Database ...
Page 210: ...190 Chapter 10 Reusing Code ...
Page 232: ...212 Chapter 11 Preventing and Handling Errors ...
Page 238: ...218 Chapter 12 Using the Application Framework ...
Page 262: ...242 Chapter 12 Using the Application Framework ...
Page 278: ...258 Chapter 13 Extending ColdFusion Pages with CFML Scripting ...
Page 320: ...300 Chapter 15 Indexing and Searching Data ...
Page 336: ...316 Chapter 16 Sending and Receiving E mail ...
Page 374: ...354 Chapter 18 Interacting with Remote Servers ...