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

Lesson 13. Creating Forms > Adding Checkboxes

Adding Checkboxes

Checkboxes allow users to choose one or more options in a group of related items. Checkboxes 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 checkboxes.

1.
In the myform.htm document, type Which adventure trips would you be interested in? in row 5 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. The checkboxes will be place on this blank line in the following steps.

2.
Choose Insert > Form Objects > Check Box.

A checkbox is inserted into the form, and the property inspector displays checkbox properties.

3.
In the document window, position the insertion point to the right of the checkbox and type Mountain Biking. Select the checkbox again by clicking it.

The property inspector displays the checkbox properties again.

4.
In the Name text box on the property inspector, replace checkbox with biking. In the Checked Value text box, type yes.

When the visitor to the page checks the biking checkbox, the name and value will be passed to the CGI to indicate that the checkbox has been selected.

5.
Position the insertion point on a line below Mountain Biking using a line break. Repeat steps 2 through 5, adding checkboxes for White Water Rafting, Sea Kayaking, and Rock Climbing, each on a separate line. In the Name text box on the property inspector, replace checkbox each time with rafting, kayaking, and climbing, respectively. Type yes in each Checked Value text box.

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

6.
Save the file and preview it in the browser.

Leave this file open for the next exercise.


PREVIEW

                                                                          

Not a subscriber?

Start A Free Trial


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