Ver Mensaje Individual
  #2 (permalink)  
Antiguo 07/07/2007, 07:47
Avatar de Adler
Adler
Colaborador
 
Fecha de Ingreso: diciembre-2006
Mensajes: 4.671
Antigüedad: 17 años, 4 meses
Puntos: 126
Re: Problemas con fechas

Prueba esto

Código HTML:
<html>
<head>
<script language="javascript" type="text/javascript">
function MosFech () {
var f = document.getElementById("fecha");
var hoy
hoy=new Date();
var ano
ano = hoy.getFullYear() +1 ;
var mes
mes = parseInt(hoy.getMonth()) + 1 ;
var dia
dia = hoy.getDate();
alert(dia);
f.value = dia + '/' + mes + "/" + ano;
}
</script>
</head>
<body>
<form>
<input type="text" id="fecha" value="" />
<br>
<input type="button" value="Fecha" onclick="MosFech(); />
</form>
</body>
</html> 
Suerte