Ver Mensaje Individual
  #2 (permalink)  
Antiguo 26/03/2004, 13:44
Avatar de JavierB
JavierB
Colaborador
 
Fecha de Ingreso: febrero-2002
Ubicación: Madrid
Mensajes: 25.052
Antigüedad: 23 años
Puntos: 772
Hola, dazuaga.

Prueba esto a ver si es lo que buscas:
Código PHP:
<html>
<
head>
<
script>
function 
contar(frm) {
    
maximo=1;
    
elem=frm.form.elements;
    
num=0;
    for(
i=0;i<elem.length;i++)
        if(
elem[i].type=='checkbox')
            if(
elem[i].checked)
                
num++
    if (
num>maximo) {
        
alert('maximo 1 checkbox');
        
frm.checked=false;
    }
}
</script>
</head>

<body>
<form>
<input type="checkbox" onclick="contar(this)" />
<input type="checkbox" onclick="contar(this)" />
<input type="checkbox" onclick="contar(this)" />
</form>
</body>
</html> 
Saludos,