SQL PHP HTML JavaScript articles and free code If you are facing any problem in viewing this page, please tell us
 

Radio Button


Radio buttons are mainly used when the user has to select only one among a group of options. Radio button has two states and can toggle between them.

Note:
Several radio buttons can be grouped together so that only one radio button can be selected at any given time. We can group radio buttons by giving same name to all the radiobuttons.

A single radio button can be created as :
<input type="radio" name="radiogroupname" value="value of the object" checked>

Attributes of Radio Button Field:
Name: Specifies the group name of the object.
Value: Specifies the value of the radio button.
Checked:  If given, the radiobutton will be selected else, it will not be selected.
Align:  Specifies the alignment of the radio buttons.

Example:
Gender: <input type="radio" name="grpGender" value="Male" Checked>  <input type="radio" name="grpGender" value="Female">
The above code places two radio buttons with a group name of "grpgender", one with a value "Male" and other one with value "Female". As the checked property is given for the first radio button it will be selected by default. This will give the output like :

Gender: MaleFemale


Form Fields  | Text Field  | Hidden Field  | Password Field  | TextArea  | RadioButton  | Checkbox  | Button  | Image Button  | Submit Button  | Two Submit Buttons | Submit new window  | Reset Button  | Drop-Down Menu


Sections
PHP
JavaScript
ASP
HTML
SQL
Photoshop
Articles SEO
List of HTML Tutorial
<Form>
HTML Tags
HTML Calendar
Tags on web page
Web Design
Subscribe
Submit your email address and receive article and product notifications. Your email is safe with us.