Worth2Read Home Page

Tutorials
Reliable $1 Web Hosting by 3iX
 

Radio Buttons

Radio buttons are helpful if you want to allow your visitor to select only one, given a number of options.

Attributes of radio button

  • name : It indicates the group in which the field belongs

  • value : This is the value of the radiogroup when the form is submitted.

  • checked : This attribute can be used to check one of the radio button automatically.

  • disabled: This attribute can be used to disable any of the radio buttons.

  • onblur, onclick, ondblclick, onfocus, onkeydown, onkeypress, onkeyup, onmousedown, onmousemove, onmouseout, onmouseover, onselect etc can be used to write functions.

Example

                                      
                

 

Code for the above radio buttons

<body>
<form id="form1" name="form1" method="post" action="">
<p>
<label>
<input type="radio" name="RadioGroup1" value="1" />
Username1 From database1</label>

<label>
<input type="radio" name="RadioGroup1" value="3" />
Username2 from Database2</label>

<label>
<input type="radio" name="RadioGroup1" value="4" />
GroupName1 From database2</label>

<label>
<input type="radio" name="RadioGroup1" value="2" />
GroupName2 From database1</label>
<br />
</p>
<label>
<input type="radio" name="RadioGroup1" value="" />
<input type="text" /></label>

</form>

Untitled Document

Copyright © 2008 www.worth2read.org. All rights Reserved. Use of this Site is subject to our Privacy Statement