Operation Manual
589
USING DREAMWEAVER
Building applications visually
Last updated 3/28/2012
Building a record insert page
About building record insert pages
Your application can contain a page that lets users insert new records in a database.
An insert page consists of two building blocks:
• An HTML form that lets users enter data
• An Insert Record server behavior that updates the database
When a user clicks Submit on a form, the server behavior inserts records in a database table.
You can add these building blocks in a single operation using the Record Insertion Form data object or you can add
them separately using the Dreamweaver form tools and the Server Behaviors panel.
Note: The insert page can contain only one record-editing server behavior at a time. For example, you cannot add an
Update Record or a Delete Record server behavior to the insert page.
Build an insert page block by block
You can also build an insert page by using the forms tools and server behaviors.
More Help topics
“Creating web forms” on page 626
Add an HTML form to an insert page
1 Create a dynamic page (File > New > Blank Page), and lay out your page using the Dreamweaver design tools.
2 Add an HTML form by placing the insertion point where you want the form to appear and selecting Insert >
Form
> Form.
An empty form is created on the page. You may have to enable Invisible Elements (View > Visual Aids > Invisible
Elements) to see the form’s boundaries, which are represented by thin red lines.
3 Name the HTML form by clicking the <form> tag at the bottom of the Document window to select the form,
opening the Property inspector (Window
> Properties), and entering a name in the Form Name box.
You don’t need to specify an action or method attribute for the form to tell it where and how to send the record data
when the user clicks the Submit button. The Insert Record server behavior sets these attributes for you.
4 Add a form object such as a text field (Insert > Form > Text Field) for each column in the database table you want
to insert records into.
The form objects are for data entry. Text fields are common for this purpose, but you can also use menus, options, and
radio buttons.
5 Add a Submit button to the form (Insert > Form > Button).
You can change the label of the Submit button by selecting the button, opening the Property inspector (Window >
Properties), and entering a new value in the Label box.
Add a server behavior to insert records in a database table (ColdFusion)
1 In the Server Behaviors panel (Window > Server Behaviors), click the Plus (+) button and select Insert Record from
the pop-up menu.