Radio buttons in a form : RadioButton Radio « Form Control « JavaScript DHTML






Radio buttons in a form

  
<html>

<head>
<script type="text/javascript">
    function check(browser){
        document.forms[0].answer.value=browser
    }
</script>

</head>

<body>
<form>Select which browser is your favorite:<br>
<input type="radio" name="browser" onclick="check(this.value)" 
            value="Internet Explorer">Internet Explorer<br>
<input type="radio" name="browser" onclick="check(this.value)" 
            value="Netscape">Netscape<br>
<input type="radio" name="browser" onclick="check(this.value)" 
            value="Opera">Opera<br>
<br>
<input type="text" name="answer" size="20">
</form>
</body>

</html>




           
         
    
  








Related examples in the same category

1.'defaultChecked' Example
2.Radio Button status Example
3.Check a Radio Button
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
12.Get the select radio button and its value
13.Cycle the selected radio buttons