Ver Mensaje Individual
  #1 (permalink)  
Antiguo 05/04/2013, 02:49
cachimira
 
Fecha de Ingreso: noviembre-2010
Mensajes: 24
Antigüedad: 13 años, 5 meses
Puntos: 0
Control de fechas para dos calendarios JavaScript (jscalendar)

Buenos días,

tengo una duda con calendarios en JavaScript, usando 'jscalendar'.
He conseguido que funcionen un par de ellos en mi código en PHP de forma correcta. Uno sirve para una fecha de inicio y el otro para una fecha de fin.
Lo que no veo como hacer es que, una vez escogida la fecha de inicio solo se pueda escoger una fecha de fin posterior a la primera. Lo que hacen por ejemplo en varias webs para escoger vuelos de ida y de vuelta.

Mi código es este:
Código PHP:
Ver original
  1. ...
  2. <td>
  3.     <input align="center" type="text" name="data_ini" id="data_ini" readonly="1"/>
  4.     <img src="jscalendar/img_ctns.gif" id="f_trigger_a" title="Date selector" onmouseover="this.style.background='red';" onmouseout="this.style.background=''" />
  5.     <script type="text/javascript">
  6.         Calendar.setup({
  7.             inputField     :    "data_ini",     // id of the input field
  8.             ifFormat       :    "%d/%m/%Y",      // format of the input field
  9.             button         :    "f_trigger_a",  // trigger for the calendar (button ID)
  10.             singleClick    :    true
  11.         });
  12.     </script>
  13. </td>
  14. <td>
  15.     <input align="center" type="text" name="data_fi" id="data_fi" readonly="1"/>
  16.     <img src="jscalendar/img_ctns.gif" id="f_trigger_b" title="Date selector" onmouseover="this.style.background='red';" onmouseout="this.style.background=''" />
  17.     <script type="text/javascript">
  18.         Calendar.setup({
  19.             inputField     :    "data_fi",     // id of the input field
  20.             ifFormat       :    "%d/%m/%Y",      // format of the input field
  21.             button         :    "f_trigger_b",  // trigger for the calendar (button ID)
  22.             singleClick    :    true
  23.         });
  24.     </script>
  25. </td>
  26. ...


Muchas gracias!