Using Forms


In Chapter 10, "Creating Data-Driven Pages," you learned how to create ColdFusion templates that dynamically display data retrieved from databases. The Films table has just 23 rows, so the data fit easily in a Web browser window and required only minimal scrolling.

What do you do if you have hundreds or thousands of rows? Displaying all that data in one long list is impractical. Scrolling through lists of movies to find the one you want just doesn't work well. The solution is to enable users to search for what they want by specifying what they are looking for. You can allow them to enter a title, an actor's name, or part of the tag line. You can then display only the movies that meet the search criteria.

To accomplish this, you need to do two things. First, you must create your search form using the HTML <form> tags. Second, you must create a template that builds SQL SELECT statements dynamically based on the data collected and submitted by the form.

See Chapter 6, "Introducing SQL," for an explanation of the SELECT statement.




Macromedia Coldfusion MX 7 Web Application Construction Kit
Macromedia Coldfusion MX 7 Web Application Construction Kit
ISBN: 321223675
EAN: N/A
Year: 2006
Pages: 282

flylib.com © 2008-2017.
If you may any questions please contact us: flylib@qtcs.net