beautypg.com

About dynamic form objects, Insert or change a dynamic html form menu – Adobe Dreamweaver CC 2015 User Manual

Page 634

background image

627

Dynamic sites, pages and web forms

Last updated 6/3/2015

Lay out the check boxes using line breaks or a table. If you select the table option, Dreamweaver creates a single-
column table, and places the check boxes on the left and the labels on the right.

You can also set the properties in the Property inspector or directly in Code view.

About dynamic form objects

A dynamic form object is a form object whose initial state is determined by the server when the page is requested from
the server, not by the form designer at design time. For example, when a user requests a PHP page that contains a form
with a menu, a PHP script in the page automatically populates the menu with values stored in a database. The server
then sends the completed page to the user’s browser.

Making form objects dynamic can simplify site maintenance. For example, many sites use menus to present users with
a set of options. If the menu is dynamic, you can add, remove, or change menu items in a single place—the database
table in which the items are stored—to update all instances of the same menu on the site.

Insert or change a dynamic HTML form menu

You can dynamically populate an HTML form menu or list menu with entries from a database. For most pages, you can
use an HTML menu object.

Before you begin, you must insert an HTML form in a ColdFusion, PHP, or ASP page, and you must define a recordset
or other source of dynamic content for the menu.

1

Insert an HTML List/Menu form object in your page:

a.Click inside the HTML form on the page (Insert > Form > Form).

b.Select Insert > Form > List/Menu to insert the form object.

2

Do one of the following:

• Select the new or an existing HTML List/Menu form object, and then click the Dynamic button in the Property

inspector.

• Select Insert > Data Objects > Dynamic Data > Dynamic Select List.

3

Complete the Dynamic List/Menu dialog box, and click OK.

a.In the Options From Recordset pop-up menu, select the recordset to use as a content source. You also use this
menu to edit both static and dynamic list/menu items later.

b.In the Static Options area, enter a default item in the list or menu. Also, use this option to edit static entries in a
list/menu form object after adding dynamic content.

c.(Optional) Use the Plus (+) and Minus (–) buttons to add and remove items in the list. Items are in the same order
as in the Initial List Values dialog box. The first item on the list is the selected item when the page is loaded in a
browser. Use the up and down arrow buttons to rearrange items in the list.

d.In the Values pop-up menu, select the field containing the values of the menu items.

e.In the Labels pop-up menu, select the field containing the labels for the menu items.

f.(Optional) To specify that a particular menu item is selected when the page opens in a browser or when a record
is displayed in the form, enter a value equal to the menu item’s value, in the Select Value Equal To box.

You can enter a static value or you can specify a dynamic one by clicking the lightning bolt icon beside the box, and
selecting a dynamic value from the list of data sources. In either case, the value you specify should match one of the
menu item values.