View Single Post
  #3 (permalink)  
Old 11-13-09, 08:03 AM
rsmahaa rsmahaa is offline
Newbie Coder
 
Join Date: Nov 2009
Posts: 25
Thanks: 0
Thanked 0 Times in 0 Posts
This code is not working....
selection of both radiobuttons, disable check boxes

<html>
<head>
<script>
function update() {

var rb = document.getElementById("myRadioButton").value;

if (rb == 1) {

document.getElementById("x1").disabled = true;
document.getElementById("x2").disabled = true;
}else{

document.getElementById("x1").disabled = false;
document.getElementById("x2").disabled = false;
}
}
</script>
</head>
<body>
<form>
<input type="radio" name="myRadioButton" id="r1" value="1" onclick="update();" />
<input type="radio" name="myRadioButton" id="r2" value="2" onclick="update();" />

<input type="checkbox" name="myCheckBox1" id="x1" value="a" />
<input type="checkbox" name="myCheckBox1" id="x2" value="b" />
</form>
</body>
</html>

Last edited by rsmahaa; 11-13-09 at 08:14 AM.
Reply With Quote