Using forms to specify the data to retrieve

In the examples in previous chapters, you retrieved all of the records from a database table using a SQL query. However, there are many instances when you want to retrieve data based on certain criteria. For example, you might want to retrieve 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 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.

The following figure shows a form, defined by FormPage.cfm, and its associated action page, ActionPage.cfm:

Note: Because forms are standard HTML, the syntax and examples that follow provide you with just enough detail to begin using ColdFusion. For information on using ColdFusion forms defined by the cfform tag, see Building Dynamic Forms.

View comments on LiveDocs