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

Controlling <cfinsert> Form Fields

<cfinsert> instructs ColdFusion to build SQL INSERT statements dynamically. ColdFusion automatically uses all submitted form fields when building this statement.

Sometimes you might want ColdFusion to not include certain fields. For example, you might have hidden fields in your form that aren’t table columns, such as the hidden field shown in Listing 14.7.

That field might be there as part of a security system you have implemented; it isn’t a column in the table. If you try to pass this field to <cfinsert>, ColdFusion passes the hidden Login field as a column to the database. Obviously, this generates an database error, as seen in Figure 14.3, because no Login column exists in the Films table.

Figure 14.3. ...

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