Creating an Add Record Form
Forms used to add data are no different from the forms you created to search for data. As seen in Listing 14.1, the form is created using form tags, with a form control for each row table column to be inserted. Save this file as insert1.cfm (in the 14 directory under ows). You’ll be able to execute the page to display the form, but don’t submit it yet (you have yet to create the action page).
Listing 14.1. insert1.cfm—New Movie Form
<!--- Name: insert1.cfm Author: Ben Forta (ben@forta.com) Description: Table row insertion demo Created: 07/01/07 ---> <!--- Get ratings ---> <cfquery datasource="ows" name="ratings"> SELECT RatingID, Rating FROM FilmsRatings ORDER BY RatingID </cfquery> <!--- Page header ---> <cfinclude ... |
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.