BUTTONS: radio
Select ONE of the following options
RADIOBUTTONS use a similar notation to CHECKBOXES,
however only one option may be chosen among many.
Options:
VALUE="" REQUIRED
- 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 RECOMMENDED
- 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.
<FORM METHOD="POST" ACTION="/cgi-bin/post-query">
Compile program with:
<DL>
<DD>Version
<INPUT TYPE="radio" NAME="version" VALUE="4.035">4.035
<INPUT TYPE="radio" NAME="version" VALUE="4.036">4.036
<INPUT TYPE="radio" NAME="version" VALUE="5.0" CHECKED>5.0
<DD>Output to:
<INPUT TYPE="radio" NAME="output" VALUE="screen">screen
<INPUT TYPE="radio" NAME="output" VALUE="printer">printer
</DL>
</FORM>
Notes:
- As mentioned before,
RADIOBUTTONS 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, which will be introduced in the next example.
- If you have a bunch of
RADIOBUTTONS 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.
Carlos A. Pero
(c-pero@uiuc.edu)