Ver Mensaje Individual
  #5 (permalink)  
Antiguo 19/09/2007, 08:28
Avatar de JavierB
JavierB
Colaborador
 
Fecha de Ingreso: febrero-2002
Ubicación: Madrid
Mensajes: 25.052
Antigüedad: 23 años, 1 mes
Puntos: 772
Re: Problema con funcion "seleccionar todos"

Hola Carxl

Prueba este ejemplo:

Código PHP:
<html>
<
head>
<
script type="text/javascript">
function 
marcar(obj) {
  for (
i=0ele obj.form.elements[i]; i++)
    if (
ele.type=='checkbox')
      
ele.checked obj.checked;
}
</script>
</head>
<body>
<form name="f1">
Todos: <input type="checkbox" onclick = "marcar(this)" /><br />
<input type="checkbox" /><br />
<input type="checkbox" />
</form>
<form name="f2">
Todos: <input type="checkbox" onclick = "marcar(this)" /><br />
<input type="checkbox" /><br />
<input type="checkbox" />
</form>
</body>
</html> 
Saludos,