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

Lesson 11. Creating Forms > Adding Check Boxes

Adding Check Boxes

Check boxes allow users to choose one or more options in a group of related items. Check boxes are typically used when you want the user to choose as many of the listed options as desired. If you want your user to choose only one selection, then you should use a radio button as demonstrated in the exercise that follows this one. In this exercise, you will insert a group of check boxes.

1.
In the lights_quiz.html document, type Which of these fuel sources have been used in lighthouses? (Check all that apply) in row 6 of the table. Add a line break after the text by pressing Shift+Return.

Recall from Lesson 1 that a line break will move the insertion point to the next line without inserting a blank line as a regular paragraph return would do.

2.
Click the check box icon on the Forms tab of the Insert bar.

TIP

You can also choose Insert > Form Objects > Check Box.

A check box is inserted into the form, and the Property inspector displays CheckBox properties.

3.
In the document window, type Sperm whale oil after the check box. Select the check box again by clicking it.

The Property inspector displays the CheckBox properties again.

4.
In the Name text field on the Property inspector, replace “checkbox” with whale. In the Checked Value text field, type yes.

When the visitor to the page checks the Sperm whale oil check box, the name and value will be passed to the CGI and the yes value will indicate that the whale check box has been selected.

5.
Position the insertion point on a line below “Sperm Whale Oil” and insert a line break. Repeat steps 2 through 5, adding check boxes and text for Hydrogen, Kerosene, and Solar Power, each on a separate line. In the Name text field on the Property inspector, replace “checkbox” each time with hydrogen, kerosene, and solar, respectively. Type yes in each Checked Value text field.

Your document should now look similar to the example shown here.

6.
In row 7, type Which of the following have contributed to making lighthouses obsolete? and insert a line break. Type the following four choices, each on a separate line with its own check box: radar, global positioning systems, navigational buoys, and all of the above. In the Name text field on the Property inspector, replace “checkbox” each time with radar, global, buoys, and all, respectively. Type yes in each Checked Value text field.

As you continue to insert form objects, the table will expand downward to accom modate its content. As this happens, the red dotted line of the form may appear to overlap the table and not be pushed down along with the bottom of the table. If this happens, just click outside the table in the document window in order to cause Dreamweaver to refresh the table.

Leave this file open for the next exercise. You can save and preview the file in a browser.


PREVIEW

                                                                          

Not a subscriber?

Start A Free Trial


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