
20/07/2004, 13:05
|
 | Moderador extraterrestre | | Fecha de Ingreso: diciembre-2001 Ubicación: Madrid
Mensajes: 6.987
Antigüedad: 23 años, 2 meses Puntos: 61 | |
Prueba con esto:
He supuesto que todos los campos de día, año y mes se llamaban igual en los distintos formularios. Si no es así dímelo y lo cambiamos. He simplificado un poco tu código aprovechando el valor checked del checkbox. Dime que tal! Código HTML: <html>
<head>
<title>Untitled</title>
<script>
function habilitar_fecha(esto,formulario){
esto=!esto
formulario.elements['dia'].disabled=esto;
formulario.elements['mes'].disabled=esto;
formulario.elements['anio'].disabled=esto;
}
</script>
</head>
<body>
<form>
<input type="checkbox" onclick="habilitar_fecha(this.checked,this.form)">
<input type="text" name="dia" id="dia" size="2" maxlength="2" disabled>/
<input type="text" name="mes" id="mes" size="2" maxlength="2" disabled>/
<input type="text" name="anio" id="anio" size="4" maxlength="4" disabled><br>
</form>
<form>
<input type="checkbox" onclick="habilitar_fecha(this.checked,this.form)">
<input type="text" name="dia" id="dia" size="2" maxlength="2" disabled>/
<input type="text" name="mes" id="mes" size="2" maxlength="2" disabled>/
<input type="text" name="anio" id="anio" size="4" maxlength="4" disabled><br>
</form>
</body>
</html>
__________________ Cómo escribir
No hay pregunta tonta, sino tonto que quiere seguir en la ignorancia. |