Ver Mensaje Individual
  #3 (permalink)  
Antiguo 20/01/2005, 13:14
Avatar de JavierB
JavierB
Colaborador
 
Fecha de Ingreso: febrero-2002
Ubicación: Madrid
Mensajes: 25.052
Antigüedad: 22 años, 2 meses
Puntos: 772
Hola jmqc y Carlitos

Voy a poner otra forma de sumar días, que creo que es más sencilla:
Código:
<head>
<script type="text/javascript">
function sumarDias(num) {
  if(num==0) return;
  hoy=new Date();
  hoy.setTime(hoy.getTime()+num*24*60*60*1000);
  mes=hoy.getMonth()+1;
  if(mes<9) mes='0'+mes;
  fecha=hoy.getDate()+'/'+mes+'/'+hoy.getYear();
  formu.total.value=fecha;  
}
</script>
</head>
<body>
<form name="formu">
<select onchange="sumarDias(this.value)" />
<option value="0">-- Selecciona --</option>
<option value="15">15</option>
<option value="30">30</option>
<option value="60">60</option>
</select>
<input type="text" name="total" readonly="readonly" />
</form>
</body>
</html>
Saludos,