When the user submits a form, ColdFusion runs the action page specified by the cfform
or form
tag action
attribute. 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. The following sections describe how to create effective 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.
On the action page, the form variables are in the Form scope, so you should prefix them with "Form." to explicitly tell ColdFusion that you are referring to a form variable. For example, the following code references the LastName form variable for output on an action page:
<cfoutput> #Form.LastName# </cfoutput>
The Form scope also contains a list variable called Form.fieldnames
. It contains a list of all form variables submitted to the action page. If no form variables are passed to the action page, ColdFusion does not create the Form.fieldnames
list.