Web Design

(Nancy Kaufman) #1

261


CHAPTER

Adding Forms to Your Site 11


TIP


How can I force my user to select one of the radio buttons?
Like check boxes, radio buttons take an optional checked value to preselect one. However, a user can
deselect the check box without selecting another, thus submitting the form with no check boxes selected.
If you preselect a radio button, your user can deselect it only by choosing another button in the group.
Thus, preselecting a radio button with the checked attribute in essence forces your user to select at least
one of the buttons.

● When the page is viewed in
the browser, the radio
buttons appear. Only one of
them may be selected at the
same time.

7 Within the form, type


.

9 Repeat Steps 2 to 8 to add
additional radio buttons.


Note: Be sure that all of the
name attributes are the same.


7


8


9

Free download pdf