Hola angel_dope
Mira a ver si funciona así.
Código PHP:
function countChoices(obj) {
max = 5; // max. number allowed at a time
//alert(document.form.PollVote.length)
count= 0
for(var counter= 0; counter < document.form.PollVote.length; counter++){
if(document.form.PollVote[counter].checked){
count++
}
}
// If you have more checkboxes on your form
// add more (box_ ? 1 : 0) 's separated by '+'
if (count > max) {
alert("Atencion! Solo puede seleccionar " + max + " opcion! \Quite una de ellas si quiere seleccionar otra.");
obj.checked = false;
}
}
</script>
Un saludo