Operation Manual
594
USING DREAMWEAVER
Building applications visually
Last updated 3/28/2012
5 Add a form object such as a text field (Insert > Form > Text Field) for each column you want to update in the
database table.
The form objects are for data entry. Text fields are common for this purpose, but you can also use menus, options, and
radio buttons.
Each form object should have a corresponding column in the recordset you defined earlier. The only exception is the
unique key column, which should have no corresponding form object.
6 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.
Display the record in the form
1 Make sure you defined a recordset to hold the record the user wants to update.
See “Retrieve the record to update” on page 592.
2 Bind each form object to data in the recordset, as described in the following topics:
• “Display dynamic content in HTML text fields” on page 635
• “Dynamically preselect an HTML check box” on page 636
• “Dynamically preselect an HTML radio button” on page 636
• “Insert or change a dynamic HTML form menu” on page 634
• “Make existing HTML form menus dynamic” on page 635
Add a server behavior to update the database table
1 In the Server Behaviors panel (Window > Server Behaviors), click the Plus (+) button and select Update Record
from the pop-up menu.
The Update Record dialog box appears.
2 Select a form from the Submit Values From pop-up menu.
3 In the Data Source or Connection pop-up menu, select a connection to the database.
4 Enter your user name and password if applicable.
5 In the Update Table pop-up menu, select the database table that contains the record you are updating.
6 (ColdFusion, PHP) Specify a database column to update, select the form object that will update the column from
the Value pop-up menu, select a data type for the form object from the Submit As pop-up menu, and select Primary
Key if you want to identify this column as the primary key.
The data type is the kind of data the column in your database table is expecting (text, numeric, Boolean option values).
Repeat the procedure for each form object in your form.
7 (ASP) In the Select Record From pop-up menu, specify the recordset that contains the record displayed in the
HTML form. In the Unique Key Column pop-up menu, select a key column (usually the record ID column) to
identify the record in the database table. Select the Numeric option if the value is a number. A key column usually
accepts only numeric values, but sometimes accepts text values.
8 In the After Updating or On Success, Go To box, enter the page to open after the record updates in the table or click
the Browse button to browse to the file.