Introduction
Text
Formatting
Links
Lists
Images
Tables
Frames
Forms
Interacting with Forms
Form Tag
Text
Checkbox
Radio
Password
Hidden
Submit
Image
Reset
Select
Textarea
Conclusion


Input Tag: Radio
The radio field is a small empty circle, when selected the circle is filled in with a dot. . Unlike the checkbox fields, a grouped set of radio buttons is to allow the user only one option. The basic radio field code will look like this:

<INPUT TYPE="radio">

You can further customize it by adding more attributes to the <INPUT> tag.

The VALUE attribute sends it's value to the CGI script only if it is selected.

The NAME attribute assigns a name to this input field. If you have a set of radio buttons that should be grouped together then you will want to name them all the same name, since you can only select one of a group it needs to identify which group the button is in.

The CHECKED attribute does not have a value and it will place a dot in the button as the default.

The TABINDEX attribute specifies the order in which the field will be activated by pressing the tab button.

Here is an example of a complete radio field:

<FORM ACTION="#">
Do you like hamsters?<BR>
<INPUT TYPE="radio" NAME="hamsters" VALUE="yes" TABINDEX="1" CHECKED> Yes<BR>
<INPUT TYPE="radio" NAME="hamsters" VALUE="no" TABINDEX="3"> No<BR><BR>
Do you like dogs?<BR>
<INPUT TYPE="radio" NAME="dogs" VALUE="yes" TABINDEX="2" CHECKED> Yes<BR>
<INPUT TYPE="radio" NAME="dogs" VALUE="no" TABINDEX="4"> No<BR>
</FORM>


Here is how it will look:

Do you like hamsters?
Yes
No

Do you like dogs?
Yes
No
back  next

© Copyright 2000-2002 by Pepmint.com. All Rights Reserved

Search Pepmint.com

home :: tutorial :: portfolio :: links :: hammies :: guestbook :: contact