HTML Forms: Radio Buttons
The Radio type means that the user can only select one
checkbox at one time; clicking on another causes the existing one to
become unchecked.
RADIO buttons are similar to CHECKBOXES,
but only one option may be chosen among many.
<Form ACTION="/cgi-bin/web-exe">
<table border=2>
<tr>
<td align=right>
<INPUT TYPE="radio" NAME="group" VALUE="Title" Checked>
<font size="4"> Title</font>
</td>
<td align=center>
<INPUT TYPE="radio" NAME="group" VALUE="Description">
<font size="4"> Description</font>
</td>
<td align=left>
<INPUT TYPE="radio" NAME="group" VALUE="URL">
<font size="4"> URL</font>
</tr>
</table>
</form>
-
NAME
-
VALUE
- Specifies the value of the option to be sent to the server.
- If not defined, a value of "on" is sent to the server.
-
CHECKED
- This tag specifies which radiobutton to be selected by default.
Since it is implied that a selection will be made, it is best
to provide a default selection.
-
RADIO buttons are not good for lists with many items,
because the browser has trouble displaying a lot of buttons.
It would be best to use a SELECT menu element.
- Once a radiobutton is selected, it cannot be deselected
without choosing a radiobutton with the same
NAME.
The default selection can be restored with the use of the
RESET button.
- If you have a bunch of
RADIO buttons with the same
NAME and no VALUES specified, the server
won't be able to tell which is selected, since a default value of
"on" will be sent.
|