DREAMWEAVER CS3
User Guide
639
You can add the final two basic building blocks of an update page separately using the form tools and the Server
Behaviors panel.
See also
“Retrieve the record to update” on page 638
“Creating forms” on page 600
Add an HTML form to an update page
1
Create a page (File > New > Blank Page). This becomes your update page.
2
Lay out your page using the Dreamweaver design tools.
3
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.
4
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 have 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 Update Record server behavior sets these attributes for you.
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 638.
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 609
•
“Dynamically preselect an HTML check box” on page 610
•
“Dynamically preselect an HTML radio button” on page 610
•
“Insert or change a dynamic HTML form menu” on page 608
•
“Make existing HTML form menus dynamic” on page 609
September 4, 2007