Adobe 38043740 - ColdFusion Standard - Mac Development Manual page 711

Developing applications
Hide thumbs Also See for 38043740 - ColdFusion Standard - Mac:
Table of Contents

Advertisement

DEVELOPING COLDFUSION 9 APPLICATIONS
Requesting and Presenting Information
<cfinput type="radio" name="Department" value="Training">Training<br>
<cfinput type="radio" name="Department" value="Sales">Sales<br>
<input type="radio" name="Department"
value="Marketing">Marketing<br>
</p>
<!--- Check box. --->
<p>
Contractor? <cfinput type="checkbox" name="Contractor"
value="Yes" checked>Yes
</p>
<!--- Reset button. --->
<cfinput type="Reset" name="ResetForm" value="Clear Form">
<!--- submit button --->
<cfinput type="Submit" name="SubmitForm" value="Submit">
</cfform>
</body>
</html>
Forms guidelines
When using forms, keep in mind the following guidelines:
• To make the coding process easy to follow, name form controls the same as target database fields. For example, if
a text control corresponds to a data source FirstName field, use FirstName as the control name.
• For ease of use, limit radio buttons to between three and five mutually exclusive options. If you need more options,
consider a drop-down list.
• Use list boxes to allow the user to choose from many options or to choose multiple items from a list.
• Check boxes, radio buttons, and list boxes do not pass data 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. For information on
how to determine whether a variable exists on the action page, see
• You can dynamically populate drop-down lists using query data. For more information, see
populating list
boxes" on page 718.
Working with action pages
When the user submits a form, ColdFusion runs the action page specified by the
A ColdFusion action page is like any other application page, except that you can use the form variables that are passed
to it from an associated form.
Processing form variables on action pages
The action page gets a form variable for every form control that contains a value when the form is submitted.
Note: If multiple controls have the same name, one form variable is passed to the action page with a comma-delimited
list of values.
A form variable's name is the name that you assigned to the form control on the form page. Refer to the form variable
by name within tags, functions, and other expressions on an action page.
"Testing for a variable's
Last updated 1/20/2012
existence" on page 709.
"Dynamically
or
tag
attribute.
cfform
form
action
706

Advertisement

Table of Contents
loading

This manual is also suitable for:

Coldfusion 9

Table of Contents