Creating Forms

Before you can create a search form, you need to learn how ColdFusion interacts with HTML forms. Listing 12.1 contains the code for a sample form that prompts for a first and last name. Create this template, then save it in a new folder named 12 (under the application root) as form1.cfm.

Tip

As a reminder, the files created in this chapter are in directory 12, so use that in your URLs too.

Listing 12.1. form1.cfm—HTML Forms
<!--- Name: forms.cfm Author: Ben Forta (ben@forta.com) Description: Introduction to forms Created: 07/01/07 ---> <html> <head> <title>Learning ColdFusion Forms 1</title> </head> <body> <!--- Movie search form ---> <form action="form1_action.cfm" method="POST"> Please enter the movie name and then click <strong>Process</strong>. ...

Get Adobe ColdFusion 8 Web Application Construction Kit, Volume 1: Getting Started now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.