O'Reilly logo

Adobe ColdFusion 8 Web Application Construction Kit, Volume 1: Getting Started by Charlie Arehart, Raymond Camden, Ben Forta

Stay ahead with the world's most comprehensive technology and business learning platform.

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, tutorials, and more.

Start Free Trial

No credit card required

Building a Data Update Form

Populating an HTML form is a simple process. First, you must retrieve the row to be updated from the table. You do this with a standard <cfquery>; the retrieved values are then passed as attributes to the HTML form.

Listing 14.9 contains the code for update1.cfm, a template that updates a movie. Save it as update1.cfm, and then execute it. Be sure to append the FilmID—for example, ?FilmID=13—as a URL parameter. Your screen should look like Figure 14.4.

Listing 14.9. update1.cfm—Movie Update Form
<!--- Name: update1.cfm Author: Ben Forta (ben@forta.com) Description: Table row update demo Created: 07/01/07 ---> <!--- Check that FilmID was provided ---> <cfif NOT IsDefined("URL.FilmID")> <h1>You did not specify the FilmID</h1> ...

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, interactive tutorials, and more.

Start Free Trial

No credit card required