morty
10-17-2003, 10:54 AM
Where is my mistake? I want to set disabled=false for three radiobuttons by clicking in a checkbox and diable them when I uncheck the Checkbox. My script is somehow not working...? I would be thankfull for a hint!
<html>
<head>
<script type="text/javascript">
function changer()
if(this.form2.activator.checked){
this.form2.decision[0].disabled=false;
this.form2.decision[1].disabled=false;
this.form2.decision[2].disabled=false;
}else{
{
this.form2.decision[0].disabled=true;
this.form2.decision[1].disabled=true;
this.form2.decision[2].disabled=true;
}
</script>
</head>
<body>
<table width="400" border="1" cellpadding="0" cellspacing="0">
<form name="form2" method="post" action="">
<tr>
<td colspan="3"> <input type="checkbox" name="activator" value="checkbox" onClick="changer()">
</tr>
<tr>
<td width="100"><input type="radio" name="decision" value="first" disabled="true"> </td>
<td width="100"><input type="radio" name="decision" value="second" disabled="true"></td>
<td width="100"><input type="radio" name="decision" value="third" disabled="true"></td>
</tr>
</form>
</table>
</body>
</html>
<html>
<head>
<script type="text/javascript">
function changer()
if(this.form2.activator.checked){
this.form2.decision[0].disabled=false;
this.form2.decision[1].disabled=false;
this.form2.decision[2].disabled=false;
}else{
{
this.form2.decision[0].disabled=true;
this.form2.decision[1].disabled=true;
this.form2.decision[2].disabled=true;
}
</script>
</head>
<body>
<table width="400" border="1" cellpadding="0" cellspacing="0">
<form name="form2" method="post" action="">
<tr>
<td colspan="3"> <input type="checkbox" name="activator" value="checkbox" onClick="changer()">
</tr>
<tr>
<td width="100"><input type="radio" name="decision" value="first" disabled="true"> </td>
<td width="100"><input type="radio" name="decision" value="second" disabled="true"></td>
<td width="100"><input type="radio" name="decision" value="third" disabled="true"></td>
</tr>
</form>
</table>
</body>
</html>