A ver si te entendí:
Código PHP:
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title>Documento sin título</title>
<script type="text/javascript">
function ver(f){
var els=f.getElementsByTagName('input');
var checks=0;
for(var i=0,ch;ch=els[i];i++){
if(ch.type=='checkbox' && ch.checked){
checks=1;
alert('al menos uno');
break;
}
}
if(!checks)alert('ninguno');
return checks;
}
</script>
</head>
<body>
<form id="form1" name="form1" method="post" action="" onsubmit="return ver(this)">
<input name="" type="checkbox" value="" />
<input name="" type="checkbox" value="" />
<input name="" type="checkbox" value="" />
<input name="" type="checkbox" value="" />
<input name="" type="checkbox" value="" />
<input name="" type="checkbox" value="" />
<input name="" type="checkbox" value="" />
<input name="" type="checkbox" value="" />
<input name="" type="checkbox" value="" />
<input name="" type="checkbox" value="" />
<input name="" type="checkbox" value="" />
<input name="" type="submit" value="Enviar" />
</form>
</body>
</html>
Cita: Creo que lo que necesitas es un XOR. Lamentablemente esto no existe en JS, pero es fácilmente imitable
amigo _cronos2, tengo que contradecirte:
Código PHP:
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title>Documento sin título</title>
<script type="text/javascript">
function out(t){
document.getElementById('log').innerHTML+=t+'<br />';
}
function XOR(a, b){ return (a || b) && !(a && b); }
onload=function(){
out(XOR(true, true)); // false
out(XOR(false, false)); // false
out(XOR(true, false)); // true
out('---------------------');
out(true ^ true);
out(false ^ false);
out(true ^ false);
}
</script>
</head>
<body>
<div id="log"></div>
</body>
</html>