Hola
maderic_m
Prueba este código:
Código PHP:
<html>
<head>
<script type="text/javascript">
function contar(frm) {
suma = 0;
for (i=0; ele = frm.elements[i]; i++)
if (ele.checked) suma++;
if (suma>2) {
alert('Sólo 2');
return false;
}
}
</script>
</head>
<body>
<form onsubmit = "return contar(this)">
<input type="checkbox" />
<input type="checkbox" />
<input type="checkbox" />
<input type="submit" />
</form>
</body>
</html>
Saludos,