Ver Mensaje Individual
  #1 (permalink)  
Antiguo 31/05/2011, 07:12
Zendar
 
Fecha de Ingreso: agosto-2010
Mensajes: 67
Antigüedad: 13 años, 8 meses
Puntos: 0
Form dialog + datetime picker

Buenos dias. Realiza un form dialog con jquery el cual tiene dos datetime picker.. cuando presiono el boton que abre el form dialog, el mismo se abre correctamente pero con el primer datetime picker desplegado.. yo quiero q se despliegue recien cuando el usuario presione sobre la caja de texto del datetime.. Espero que se entienda.. aqui dejo el codigo:

Código Javascript:
Ver original
  1. $( "#dialog-form" ).dialog({
  2.             autoOpen: false,
  3.                         title:"Setear fechas" ,
  4.             height: 450,
  5.             width: 400,
  6.                         modal: true,
  7.             buttons: {
  8.                 "Aceptar": function() {
  9.                                            dataString = $('form').serialize();
  10.  
  11.                                             $.ajax({
  12.  
  13.                                             type: "POST",
  14.  
  15.                                             url: "../ejemplo.php",
  16.  
  17.                                             data: dataString,
  18.  
  19.                                             dataType: "json"
  20.  
  21.                                            
  22.                                             });
  23.  
  24.                         $( this ).dialog( "close" );
  25.                 },
  26.                 "Cancelar": function() {
  27.                     $( this ).dialog( "close" );
  28.                 }
  29.             },
  30.                                 "close": function() {
  31.                 $( this ).dialog( "close" );
  32.             }
  33.         });
  34.                   $("#fecha_inicio").datepicker({altFormat: 'yy-mm-dd',minDate: '-1y'});
  35.                 $("#fecha_fin").datepicker({altFormat: 'yy-mm-dd',minDate: '-1y'});
  36.        
  37.        $( "#abrir_dialog" )
  38.             .button()
  39.             .click(function() {
  40.                 $( "#dialog-form" ).dialog( "open" );
  41.                                
  42.             });


y el codigo del formulario:


Código HTML:
Ver original
  1. <form id="form" name="form">
  2.                 <label for="fecha_inicial">Fecha Inicio</label>
  3.                 <input type="text" id="fecha_inicio" name="fecha_inicio"/>
  4.                 <br/>
  5.         <label for="fecha_final">Fecha Fin</label>
  6.              <input type="text" id="fecha_fin" name="fecha_fin"/>
  7.                 <br/>
  8.         </form>

Espero que alguien pueda ayudarme,, gracias!