Ford & Mason Ltd
HOME
ABOUT
CONTACT
RESOURCES
ADVERTISING



donations support the development of
cronolog.org
and
refcards.com

next up previous contents index
Next: Check boxes Up: Defining fields Previous: Hidden fields


Radio buttons

Radio 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 up previous contents index
Next: Check boxes Up: Defining fields Previous: Hidden fields

[ITCP]Spinning the Web by Andrew Ford
© 1995 International Thomson Publishing
© 2002 Andrew Ford and Ford & Mason Ltd
Note: this HTML document was generated in December 1994 directly from the LaTeX source files using LaTeX2HTML. It was formatted into our standard page layout using the Template Toolkit. The document is mainly of historical interest as obviously many of the sites mentioned have long since disappeared.

 
Copyright © 1996-2002 Ford & Mason Ltd