• Create BookmarkCreate Bookmark
  • Create Note or TagCreate Note or Tag
  • PrintPrint
Share this Page URL

Lesson 13. Creating Forms > Adding List/Menu Items

Adding List/Menu Items

A list/menu enables users to pick options from a scrolling list or menu. A scrolling list gives you the option to allow users to make multiple contiguous or noncontiguous selections. A drop-down menu restricts users to one selection. In both types, items chosen by the user will be highlighted.

In the myform.htm document, type Which region are you interested in exploring? in row 7 of the table and insert a line break.

In the following steps, you will place a scrolling list with six menu options on the same line as this text.

Choose Insert > Form Objects > List/Menu. On the property inspector, select List for the Type option and change the Height to 4.

A small menu is inserted into the form, and the property inspector displays Menu properties. Dreamweaver inserts a drop-down menu by default. You've changed the format to a scrolling list. Check the Allow Multiple checkbox for the Selections option.

List has two additional options. You can choose to allow or not allow multiple selections by checking or unchecking the selections checkbox. This option is unchecked by default. If you check the selections box, users can make multiple noncontiguous selections by using Command-click on the Macintosh and Ctrl-click on Windows. Users may make contiguous selections by using Shift-click on both Macintosh and Windows.

You can also set a height for the scrolling list by typing in the Height text box the number of lines that you want to be visible. If you leave the selections checkbox unchecked, be sure to enter a line height value of more than one. Otherwise the scrolling list will display as a menu. You should always define the height for a scrolling list; if you don't, the number of lines displayed will be the browser default, which varies.

In the Name text box, replace select with region and click List Values.

The List Values dialog box opens. This dialog box is the same for both List and Menu.

In the Item Label field, type Africa and then press Tab.

The longest item in the list values box determines the width of the list/menu.

In the Value field, again type Africa.

This text is sent to the CGI or server to indicate that the option has been selected.

Press Tab or click the plus (+) sign in the dialog box to add another option to the menu.

Use the minus (–) sign to delete items from the list values box.

Repeat steps 4 through 6, adding Australia, North America, South America, Caribbean, and Europe to the list. Change the Value field to match the name of each region.

Use the arrows above the Value field if you want to reorder the list.

Click OK to close the dialog box.

The list shows the regions you just added.

An additional option on the property inspector for list/menu items is the Initially Selected box. You can choose to have any one of the items in the list be selected when the page loads. This might not be desirable for scrolling lists, but for menu items it is helpful for the drop-down menu to have a sample choice or instruction appear on the first line.

Save the file and preview it in the browser.

Leave this file open for the next exercise.



Not a subscriber?

Start A Free Trial

  • Creative Edge
  • Create BookmarkCreate Bookmark
  • Create Note or TagCreate Note or Tag
  • PrintPrint