
03/11/2004, 03:17
|
 | Moderador extraterrestre | | Fecha de Ingreso: diciembre-2001 Ubicación: Madrid
Mensajes: 6.987
Antigüedad: 23 años, 2 meses Puntos: 61 | |
Este ejemplo: Código HTML: <html>
<head>
<title>Untitled</title>
<script>
function marcarTodos(marca){
formulario=document.forms["pepe"];
for(a=0;a<formulario.length;a++){
if(formulario.elements[a].type=="checkbox"){
formulario.elements[a].checked=marca;
}
}
}
</script>
<style>
*{font:normal 10px/20px verdana}
</style>
</head>
<body>
<form action="salchicha.php" name="pepe">
Nombre:<input type="text" name="nombre"><br>
Regimen:<select type="select" name="cosas" size="1">
<option>vegetariano
<option>Carnívoro
<option>Postrivoro
</select><br>
<input type="checkbox" name="campo[]">Comer Salchichas<br>
<input type="checkbox" name="campo[]">Comer Brocoli<br>
<input type="checkbox" name="campo[]">Comer Arroz<br>
<input type="checkbox" name="campo[]">Comer Pepinillo<br><br>
<input type="checkbox" name="DesYMarcarTodos" onclick="marcarTodos(this.checked)">* * *Comerlo todo * * *
</form>
</body>
</html> Funciona en IE, en NS 4.78, en Opera, en Mozilla, en firefox...
Espero que te sirva!
__________________ Cómo escribir
No hay pregunta tonta, sino tonto que quiere seguir en la ignorancia.
Última edición por KarlanKas; 03/11/2004 a las 03:22 |