|
|||||||||
|
Radio buttonsRadio buttons are groups of related option buttons, of which only one may logically be selected at any one time, so called because their mode of action resembles that of a radio - you can't have it tuned in to more than one station at once. Radio buttons offer a choice between predetermined, mutually exclusive options. If the user clicks on a button that is not selected, it will become selected and the currently selected button in that group will be de-selected. Our example is encoded as follows:
<INPUT TYPE="radio" NAME="rb" VALUE="A" CHECKED>A <INPUT TYPE="radio" NAME="rb" VALUE="B">B <INPUT TYPE="radio" NAME="rb" VALUE="C">C Each INPUT element where TYPE="radio" defines a separate radio button. Elements with the same value for the NAME attribute form a group. The VALUE attribute is required, and specifies the data that will be sent if the form is submitted when that particular button is selected. The CHECKED attribute can be used to specify a default for a group of radio buttons, causing that button to be selected automatically when the form is first displayed. Only one radio button or no buttons in a group should have the CHECKED attribute specified. How browsers should interpret forms that have more than one radio button in a group specified as CHECKED is undefined. Some browsers select the first button with the CHECKED attribute, some the last and some browsers even select all buttons so marked!
Next: Check boxes Up: Defining fields Previous: Hidden fields
Spinning the Web by Andrew Ford |
||||||
Copyright © 1996-2002 Ford & Mason Ltd |