Building an insert page block by block

Building an insert page block by block

You can add the basic building blocks of an insert page separately using the form tools and the Server Behaviors panel.

You can also add the building blocks all at once using the Record Insertion Form application object. For more information, see Building the insert page in one operation.

The procedure to build the insert page consists of two steps:

  • Adding an HTML form to the page to let users enter data
  • Adding the Insert Record server behavior to insert records in a database table

To add an HTML form to an insert page:

  1. Create a new dynamic page (File > New) 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 text 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, checkboxes, and radio buttons.

    For more information on form objects, see Inserting HTML form objects.

  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 text box.

To add a server behavior to insert records in a database table:

  1. In the Server Behaviors panel (Window > Server Behaviors), click the Plus (+) button and select Insert Record from the pop-up menu.

    The Insert Record dialog box appears.

  2. Complete the dialog box.

    For instructions, see:

    • Setting the Insert Record dialog box options (ASP & JSP)
    • Setting the Insert Record dialog box options (PHP)
    • Setting the Insert Record dialog box options (ColdFusion)
    • Setting the Insert Record dialog box options (ASP.NET)
  3. Click OK.

Dreamweaver adds a server behavior to the page that lets users insert records in a database table by clicking the Submit button on the form.

To edit the server behavior, open the Server Behaviors panel (Window > Server Behaviors) and double-click the Insert Record behavior.



Getting Started with Dreamweaver
Dreamweaver Basics
Working with Dreamweaver Sites
Laying Out Pages
Adding Content to Pages
Working with Page Code
Preparing to Build Dynamic Sites
Making Pages Dynamic
Developing Applications Rapidly
Building ColdFusion Applications Rapidly
Reference
Building ASP.NET Applications Rapidly
Building ASP and JSP Applications Rapidly