User Guide

40 Chapter 4 Retrieving and Formatting Data
Using Forms to Specify the Data to Retrieve
In the examples in previous chapters, you have retrieved all of the records from a
table. However, there are many instances when you want to retrieve data based on
certain criteria. For example, you might want to see records for everyone in a
particular department, everyone in a particular town whose last name is Smith, or
books by a certain author.
You can use forms in ColdFusion applications to allow users to specify what data
they want to retrieve in a query. When you submit a form, you pass the variables to
an associated page, called an action page, where some type of processing takes
place.
Note
Because forms are standard HTML, the syntax and examples that follow provide you
with just enough detail to begin using ColdFusion.
form tag syntax
Use the following syntax for the create a form tag:
<form action="actionpage.cfm" method="post">
...
</form>
You can override the server request timeout (set on the ColdFusion Administrator
Server Settings page) by adding a RequestTimeout parameter to the action page
URL. The following example specifies a request timeout of two minutes:
Attribute Description
action
Specifies an action page to which you pass form variables for
processing.
method
Specifies how the variables are submitted from the browser to the
action page on the server. All ColdFusion forms must be submitted
with an attribute setting of method=post