Check a Radio Button : RadioButton Radio : Form Control : JavaScript DHTML examples (example source code) Organized by topic

JavaScript DHTML
C++
PHP


JavaScript DHTML  »  Form Control   » [  RadioButton Radio  ]   
 



Check a Radio Button

Please note that some example is only working under IE or Firefox.

    
<html>
<body>
<form>
<script>
    function function1() {
        document.all.myRadioButton1.checked = true;
    }
    function function2() {
        document.all.myRadioButton2.checked = true;
    }
    function function3() {
        document.all.myRadioButton3.checked = true;
    }
    function function4() {
        document.all.myRadioButton4.checked = true;
    }
</script>
<input id="myRadioButton1" type="radio" name="radiobutton" value="radiobutton">VISA
<input id="myRadioButton2" type="radio" name="radiobutton" value="radiobutton">MASTERCARD
<input id="myRadioButton3" type="radio" name="radiobutton" value="radiobutton">DISCOVER
<input id="myRadioButton4" type="radio" name="radiobutton" value="radiobutton">AMERICAN EXPRESS
<br>
<input type="button" value="VISA checked" onClick="function1();">
<input type="button" value="MASTERCARD checked" onClick="function2();">
<input type="button" value="DISCOVER checked" onClick="function3();">
<input type="button" value="AMERICAN EXPRESS checked" onClick="function4();">
</form>
</body>
</html>

    
      
      
Related examples in the same category
1.  'defaultChecked' Example
2.  Radio Button status Example
3.  Radio buttons in a form
4.  Using the onPropertyChange Property
5.  Radio action
6.  Methods and Properties of the Radio Object
7.  Determining the Value of the Selected Radio Button
8.  Scripting a Group of Radio Objects
9.  Finding the Selected Button in a Radio Group
10.  An onClick event Handler for Radio Buttons
11.  Get the radio button selection
























Home| Contact Us
Copyright 2003 - 04 Demo Source and Support. All rights reserved.
All other trademarks are property of their respective owners.