beautypg.com

Building a record insert page (cs6) – Adobe Dreamweaver CC 2014 v.13 User Manual

Page 576

background image

Building a record insert page (CS6)

To the top

To the top

About building record insert pages
Build an insert page block by block
Build the insert page in one operation

Note: The user interface has been simplified in Dreamweaver CC and later. As a result, you may not find some of the options described in this
article in Dreamweaver CC and later. For more information, see

this article

.

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.

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

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.

2. Select a form from the Submit Values From pop-up menu.

3. In the Data Source pop-up menu, select a connection to the database.

4. Enter your user name and password.

5. In the Insert Into Table pop-up menu, select the database table to insert the record in.

6. Specify a database column to insert the record in, select the form object that will insert the record from the Value pop-up menu, and then

select a data type for the form object from the Submit As pop-up menu.

The data type is the kind of data the column in your database table is expecting (text, numeric, Boolean option values).

569

This manual is related to the following products: