Hallo!
eigendlich dürfte das ja kein Problem sein, aber es geht nicht:
Wenn ein Radiobutton (von 3en) angeklickt wird, sollen die entsprechenden Checkboxen defaultmäßig aktiviert werden.
Hier das Beispielscript:
<script language="JavaScript">
<!--
function chkbx()
{
if(document.radios.nummer[1].checked == true){
document.checkboxen.EMailB[].defaultChecked == true;
}
else if(document.radios.nummer[2].checked == true){
document.checkboxen.EMailC[].defaultChecked == true;
}
else{
document.radios.nummer[0].defaultChecked == true;
document.checkboxen.EMailA[].defaultChecked == true;
}
}
//-->
</script>
</head>
<body onload="chkbx()">
<form name="radios">
<input type="radio" name="nummer" value="A" onclick="chbx()"> Nummer A<br>
<input type="radio" name="nummer" value="B" onclick="chbx()"> Nummer B<br>
<input type="radio" name="nummer" value="C" onclick="chbx()"> Nummer C<br><br>
</form>
<form action="auswertung.html" method="post" name="checkboxen" id="checkbox">
<input type="checkbox" name="EMailA[]" value="A-E-Mail-1"> A-E-Mail-1<br>
<input type="checkbox" name="EMailA[]" value="A-E-Mail-2"> A-E-Mail-2<br>
<input type="checkbox" name="EMailA[]" value="A-E-Mail-3"> A-E-Mail-3<br>
<input type="checkbox" name="EMailA[]" value="A-E-Mail-4"> A-E-Mail-4<br><br>
<input type="checkbox" name="EMailB[]" value="B-E-Mail-1"> B-E-Mail-1<br>
<input type="checkbox" name="EMailB[]" value="B-E-Mail-2"> B-E-Mail-2<br>
<input type="checkbox" name="EMailB[]" value="B-E-Mail-3"> B-E-Mail-3<br>
<input type="checkbox" name="EMailB[]" value="B-E-Mail-4"> B-E-Mail-4<br><br>
<input type="checkbox" name="EMailC[]" value="C-E-Mail-1"> C-E-Mail-1<br>
<input type="checkbox" name="EMailC[]" value="C-E-Mail-2"> C-E-Mail-2<br>
<input type="checkbox" name="EMailC[]" value="C-E-Mail-3"> C-E-Mail-3<br>
<input type="checkbox" name="EMailC[]" value="C-E-Mail-4"> C-E-Mail-4<br><br>
...
</form>
Wer kann helfen??
Vielen Dank im voraus