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

Lesson 10. Creating Forms > Creating a pop-up menu

Creating a pop-up menu

Pop-up menus provide viewers with multiple options from which they can choose. Now you'll add a pop-up menu that viewers will use to choose the country in which they live.

1.
Drag a Label icon from the Forms set () of the Objects palette to the sixth cell of the table.

2.
Double-click the word Label to select it. Then type Country to change the label text.

3.
Select the text that you just typed, and choose 2 from the Font Size menu () on the toolbar.

4.
Click after the label box to insert a cursor. (Be sure to click after the label, not in the label text.) Then press the spacebar to add a space.

5.
Drag a Popup icon from the Forms set of the Objects palette to the cursor in the document window. A placeholder for the pop-up menu appears in the document window.

6.
Move the pointer over the right or bottom edge of the sixth table cell until the pointer changes to an arrow. Click to select the cell.

The Inspector changes to the Table Inspector, with the Cell tab automatically selected.

7.
In the Table Inspector, choose Middle from the Vertical Alignment menu. Choose Right from the Horizontal Alignment menu.

8.
Select the pop-up menu placeholder in the document window. The Inspector changes to the Form Popup Inspector.

9.
In the Form Popup Inspector, enter countryPopup for Name. This names the pop-up menu.

You'll leave the Rows option set at 1. This means that one row (or item) will be visible in the pop-up menu.

Now you'll use the Form Popup Inspector to add items to the pop-up menu.

10.
In the Label and Value columns, click the first row to select it. (The first item is currently labeled “first” with a value of “one.”)

11.
In the text box at the bottom of the Form Popup Inspector, select the text “first,” and enter Canada to replace it. Press Tab. In the second text box, enter Country_Canada to replace the word “one,” and press Enter or Return.

The label “Canada” will appear as an item in the pop-up menu, and the value “Country_Canada” will be returned to the CGI script for the form when a visitor chooses this item.

12.
Select the second item in the list box. (The second item is currently labeled “second” with a value of “two.”) Use the text boxes at the bottom of the Form Popup Inspector to enter France as its label and Country_France as its value.

13.
Select the third item in the list box, and enter Germany as its label and Country_Germany as its value.

Now you'll add a fourth item to the pop-up menu.

14.
To create a fourth item, click the Create new item button () at the bottom of the Inspector. Then enter USA as the label and Country_USA as the value.

By default, the first item that you added to the pop-up menu (Canada) will appear in the browser. However, because most potential viewers for this particular Web site will be from the United States, you'll change the default to display USA.

15.
In the Form Popup Inspector, select the country you want to appear by default in the pop-up menu (in this case USA), and click the check box next to the text box that contains the text “USA” at the bottom of the Form Popup Inspector.

Specifying menu item to appear by default

The pop-up menu in the document window now displays the text “USA.”

16.
Choose File > Save to save the page.


PREVIEW

                                                                          

Not a subscriber?

Start A Free Trial


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