30
Using Forms to Specify the Data to Retrieve
Until now, you've retrieved all of the records from a table. However, there are many
instances when you'll want to retrieve data based on certain criteria. For example, you
may 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
FORM tag syntax
<FORM ACTION="actionpage.cfm" METHOD="Post">
...
</FORM>
Use the ACTION attribute to specify an action page to which you pass form
variables for processing.
Use the METHOD attribute to specify 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".
Form Controls
Within the form, you'll describe the form controls needed to gather and submit user
input. There are a variety of form controls types available. You choose form control
input types based on the type of input the user should provide.
Because forms are not ColdFusion-specific, the syntax and examples that
follow provide you with just enough detail to get going with ColdFusion.
Developing Web Applications with ColdFusion
Need help?
Do you have a question about the COLDFUSION 4.5-DEVELOPING WEB and is the answer not in the manual?