Programming instructions

Processing form data 27
When a user submits a form, the form values are stored in form variables and sent to the
action page for processing. The following figure shows the relationship between the form
page and action page:
In order for the form page to find its corresponding action page, the action statement in
the form tag must be correct. The form tag includes the information that tells the server
where to send the data that it collects. It also tells the server how to send it. To processes
these instructions to the server, the form tag uses the following syntax:
<form action="actionpagename.cfm" method="Post">
HTML and CFML form tags
</form>
The first attribute (action) in the form tag lets you specify where to send the data. The
page that you specify where to send the data is the name of the action page. The second
attribute in the form tag is
method. The only method that ColdFusion supports is post.
All ColdFusion forms must set the method attribute to
post.
In Part II of this book, you will use ColdFusion form tags to create forms and write
collected values to a database.
Name
E-mail
Submit
Database
form.var1=value1
form.var2=value2
Action
page
The action page contains
the code for form processing
and interaction with
database.
ColdFusion server &
Web server
Form page