gelöst mit:
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN"
"http://www.w3.org/TR/html4/loose.dtd">
<html>
<head>
<script type="text/javascript">
function checkboxOC(ele, namenRe, limit) {
var checked = 0;
var form = ele.form;
for (var i = 0; i< form.elements.length; i++){
if (form.elements[i].type == "checkbox" && form.elements[i].checked && namenRe.test(form.elements[i].name)){
checked++;
}
}
for(var i=0; i<form.elements.length; i++) {
if(form.elements[i].type == "checkbox" && namenRe.test(form.elements[i].name) && form.elements[i].checked == false) {
form.elements[i].disabled = (checked >= limit)? true: false;
}
}
}
</script>
</head>
<body>
<form name="form" action="" method="post" id="form1">
<div>
<input type="checkbox" onclick="checkboxOC(this, /^vorteil_/, 3)" name="vorteil_1" value="1">
<input type="checkbox" onclick="checkboxOC(this, /^vorteil_/, 3)" name="vorteil_2" value="1">
<input type="checkbox" onclick="checkboxOC(this, /^vorteil_/, 3)" name="vorteil_3" value="1">
<input type="checkbox" onclick="checkboxOC(this, /^vorteil_/, 3)" name="vorteil_4" value="1">
<input type="checkbox" onclick="checkboxOC(this, /^vorteil_/, 3)" name="vorteil_5" value="1"></div><div>
<input type="checkbox" onclick="checkboxOC(this, /^vorteil_/, 3)" name="vorteil_6" value="1">
<input type="checkbox" onclick="checkboxOC(this, /^vorteil_/, 3)" name="vorteil_7" value="1">
<input type="checkbox" onclick="checkboxOC(this, /^vorteil_/, 3)" name="vorteil_8" value="1">
<input type="checkbox" onclick="checkboxOC(this, /^vorteil_/, 3)" name="vorteil_9" value="1">
<input type="checkbox" onclick="checkboxOC(this, /^nachteil_/, 3)" name="nachteil_1" value="1">
<input type="checkbox" onclick="checkboxOC(this, /^nachteil_/, 3)" name="nachteil_2" value="1">
<input type="checkbox" onclick="checkboxOC(this, /^nachteil_/, 3)" name="nachteil_3" value="1">
<input type="checkbox" onclick="checkboxOC(this, /^nachteil_/, 3)" name="nachteil_4" value="1">
<input type="checkbox" onclick="checkboxOC(this, /^nachteil_/, 3)" name="nachteil_5" value="1"></div><div>
<input type="checkbox" onclick="checkboxOC(this, /^nachteil_/, 3)" name="nachteil_6" value="1">
<input type="checkbox" onclick="checkboxOC(this, /^nachteil_/, 3)" name="nachteil_7" value="1">
<input type="checkbox" onclick="checkboxOC(this, /^nachteil_/, 3)" name="nachteil_8" value="1">
<input type="checkbox" onclick="checkboxOC(this, /^nachteil_/, 3)" name="nachteil_9" value="1">
<input type="checkbox" onclick="checkboxOC(this, /^test_/, 3)" name="test_1" value="1">
<input type="checkbox" onclick="checkboxOC(this, /^test_/, 3)" name="test_2" value="1">
<input type="checkbox" onclick="checkboxOC(this, /^test_/, 3)" name="test_3" value="1">
<input type="checkbox" onclick="checkboxOC(this, /^test_/, 3)" name="test_4" value="1">
<input type="checkbox" onclick="checkboxOC(this, /^test_/, 3)" name="test_5" value="1"></div><div>
<input type="checkbox" onclick="checkboxOC(this, /^test_/, 3)" name="test_6" value="1">
<input type="checkbox" onclick="checkboxOC(this, /^test_/, 3)" name="test_7" value="1">
<input type="checkbox" onclick="checkboxOC(this, /^test_/, 3)" name="test_8" value="1">
<input type="checkbox" onclick="checkboxOC(this, /^test_/, 3)" name="test_9" value="1">
<input value="hallo">
</div>
</form>
</body>
</html>