Ver Mensaje Individual
  #2 (permalink)  
Antiguo 25/11/2007, 04:41
Avatar de JavierB
JavierB
Colaborador
 
Fecha de Ingreso: febrero-2002
Ubicación: Madrid
Mensajes: 25.052
Antigüedad: 23 años
Puntos: 772
Re: Ve3rificar checkbox que tienen por nombre un areglo

Hola Goomba

Prueba este ejemplo:

Código PHP:
<html>
<head>
<script type="text/javascript">
function validar(frm) {
  for (i=0; ele = frm['caracteristica[]'][i]; i++)
    if (ele.checked) return
  return false;
}
</script>
</head>
<body>
<form onsubmit="return validar(this)">
<input type="checkbox" name="caracteristica[]" value="<?php echo $result[$i?>">
<input type="checkbox" name="caracteristica[]" value="<?php echo $result[$i?>">
<input type="checkbox" name="caracteristica[]" value="<?php echo $result[$i?>">
<input type="submit" />
</form>
</body>
</html>
Saludos,