|    
			
				24/11/2004, 04:10
			
			
			  | 
  |   |  | Moderador extraterrestre |  |  Fecha de Ingreso: diciembre-2001 Ubicación: Madrid 
						Mensajes: 6.987
					 Antigüedad: 23 años, 10 meses Puntos: 61 |  | 
  |  Prueba con esto. Tiene un asistente para comprobar que la fecha que se introduce es válida y sigue el formato de dd/mm/aaaa
  Código HTML: <html>
<head>
	<title>Untitled</title>
	<script>
	semana=["Domingo","Lunes","Martes","Miércoles","Jueves","Viernes","Sábado"];
	mes=["enero","febrero","marzo","abril","mayo","junio","julio","agosto","septiembre","octubre","noviembre","diciembre"];
	function hacer(esto){
	if(esto.length==10){
	dia=esto.split("/");
	if(dia[0]>31 || dia[1]>12){
	alert("Compruebe la fecha");
	document.forms[0]['fecha'].value="";
	document.forms[0]['fecha'].focus();
	return false
	}
	fechas=new Date(dia[2],parseInt(dia[1])-1,dia[0]);
	larga=semana[fechas.getDay()]+", "+fechas.getDate()+" de "+mes[fechas.getMonth()]+" de "+fechas.getYear();
	document.forms[0]['fechaLarga'].value=larga;
	}
	if(esto.length==2){
		if(esto.charAt(1)!="/"){
			document.forms[0]['fecha'].value+="/";
		}
		else{
		document.forms[0]['fecha'].value="0"+esto.charAt(0)+"/";
		}
	}
	if(esto.length==5){
		if(esto.charAt(4)!="/"){
			document.forms[0]['fecha'].value+="/";
		}
		else{
		document.forms[0]['fecha'].value=esto.substring(0,3)+"0"+esto.charAt(3)+"/";
		}
	}
}
	</script>
	<style>
	*{
	font:normal 12px/12px 'courier new';
	}
	input{border:solid 1px black;}
	</style>
</head>
<body>
<form>
Introduzca una fecha (DD/MM/AAAA):<input onkeyup="hacer(this.value)" type="text" name="fecha" size="10" maxlength="10"><br>
<input type="text" size="44" name="fechaLarga">
</form>
</body>
</html>  
				__________________Cómo escribir 
No hay pregunta tonta, sino tonto que quiere seguir en la ignorancia.     |