Ver Mensaje Individual
  #2 (permalink)  
Antiguo 07/02/2004, 09:28
Avatar de tunait
tunait
Moderadora
 
Fecha de Ingreso: agosto-2001
Ubicación: Terok Nor
Mensajes: 16.805
Antigüedad: 22 años, 8 meses
Puntos: 381
A ver si te sirve algo así

<script language="JavaScript">
function edad(Fecha){
fecha = new Date(Fecha)
hoy = new Date()
ed = parseInt((hoy -fecha)/365/24/60/60/1000)
document.getElementById('pepe').value = "tienes " + ed + " años"
}
</script>
</head>

<body>

<input type="text" name="textfield" onblur="edad(this.value)" />
<input type="text" name="pepe" id="pepe" />
</body>

La fecha debe introducirse en este orden y formato


mm/dd/aaaa