Ver Mensaje Individual
  #7 (permalink)  
Antiguo 01/02/2006, 05:20
jorge_nieves
 
Fecha de Ingreso: noviembre-2005
Mensajes: 40
Antigüedad: 18 años, 5 meses
Puntos: 0
Marcar varios checkbox a la vez

No he podido hacer funcionar el ejemplo de JavierB, he intentado quitando los name de los input checkbox y tampoco funciona, aqui dejo mi codigo por si alguien sabe lo que le ocurre a mi script.

Código HTML:
<script>
function marcar(obj,chk) {
	elem=obj.getElementsByTagName('input');
  for(i=0;i<elem.length;i++)
  	elem[i].checked=chk.checked;
}
</script>		
			<form name='permisos' action="?act=3" method="post"><table border="1" width="100%">
			<TR>
				<TD>Nombre:</TD><td><input type='text' name='nombre' size="100%" maxlength="15"></td>
			</TR>
			<TR>
				<TD>Descripcion:</TD><td><input type='text' name='descripcion' size="100%" maxlength="70"></td>
			</TR>
			<tr>
				<TD colspan="2">Asignar Permisos:
					<table border="1" width="50%">

						<TR>
							<td><INPUT type='checkbox' name='todos1' onclick="marcar(this.parentNode,this)">AREA INFORMACION</TD>
						</TR>
						<TR>
							<TD>&nbsp;&nbsp;<INPUT type='checkbox' name='sel1'>Noticias</TD>
						</TR>
						<TR>
							<TD>&nbsp;&nbsp;<INPUT type='checkbox' name='sel2'>Agenda</TD>
						</TR>
						<TR>
							<TD><INPUT type='checkbox' name='todos2'>FORO</TD>
						</TR>
						<TR>
							<TD><INPUT type='checkbox' name='todos3' onclick=marcar(this.parentNode,this)>AREA COLEGIADO</TD>
						</TR>
						<TR>
							<TD>&nbsp;&nbsp;<INPUT type='checkbox' name='sel3'>Revista Prensa</TD>
						</TR>
						<TR>
							<TD>&nbsp;&nbsp;<INPUT type='checkbox' name='sel4'>Listas de correo</TD>
						</TR>
						<TR>
							<TD>&nbsp;&nbsp;<INPUT type='checkbox' name='sel5'>Consultar BD</TD>
						</TR>
						<TR>
							<TD>&nbsp;&nbsp;<INPUT type='checkbox' name='sel6'>Gestor de correo</TD>
						</TR>
						<TR>
							<TD><INPUT type='checkbox' name='todos4'>MISCEL&Aacute;NEA</TD>
						</TR>
						<TR>
							<TD><INPUT type='checkbox' name='todos5'>GESTIONAR BD</TD>
						</TR>
						<TR>
							<TD><INPUT type='checkbox' name='todos6' onclick="marcar(this.parentNode,this)">GESTIONAR CONTENIDOS</TD>
						</TR>
						<TR>
							<TD>&nbsp;&nbsp;<INPUT type='checkbox' name='sel8'>Gestionar Noticias</TD>
						</TR>
						<TR>
							<TD>&nbsp;&nbsp;<INPUT type='checkbox' name='sel9'>Gestionar Eventos</TD>
						</TR>
						<TR>
							<TD>&nbsp;&nbsp;<INPUT type='checkbox' name='sel10'>Gestionar Perfiles</TD>
						</TR>



					</table>
				</TD>
			</tr>
			<TR>
				<TD>&nbsp;&nbsp;<INPUT type='submit' name='enviar' value="Enviar"></TD>
			</TR>
			

		</table></form>