Ver Mensaje Individual
  #1 (permalink)  
Antiguo 14/07/2014, 13:58
sandragh27
 
Fecha de Ingreso: junio-2014
Mensajes: 36
Antigüedad: 9 años, 10 meses
Puntos: 0
Exclamación DataPicker en JSP

Hola, que tal? necesito ayuda con el datapicker en jsp, no se porque no me funciona. A continuacion les coloque el codigo que estoy utilizando para ver si podrian ayudarme a que funcione. Gracias.

Código Java:
Ver original
  1. <%@page contentType="text/html" pageEncoding="UTF-8"%>
  2. <%-- <%@include file="sesion.jsp" %> --%>
  3. <%@include file="conexion.jsp" %>
  4. <!DOCTYPE html>
  5.  
  6. <html>
  7.     <head>
  8.         <title>Gestionar Proyecto</title>
  9.         <script src="http://ajax.googleapis.com/ajax/libs/jquery/1.4.2/jquery.min.js"></script>
  10.         <script type="text/javascript" src="C:/Users/Sandra/Documents/NetBeansProjects/Sistema2/web/jquery-1.7.2.min.js"></script>
  11.         <script type="text/javascript" src="C:/Users/Sandra/Documents/NetBeansProjects/Sistema2/web/jquery-ui-1.10.3.custom.min.js"></script>
  12.         <script type="text/javascript" src="C:/Users/Sandra/Documents/NetBeansProjects/Sistema2/web/jquery.ui.datepicker-es.js"></script>
  13.         <link href="C:/Users/Sandra/Documents/NetBeansProjects/Sistema2/web/jquery-ui-1.10.3.custom.min.css" rel="stylesheet" type="text/css">
  14.  
  15.         <script type="text/javascript">
  16.             $(function(){
  17.  
  18.                 tabla = $('#act');
  19.                 tr = $('#fila', tabla);
  20.                 $('#agregarFila').live('click', function (){
  21.                     tr.clone().appendTo(tabla).find(':text, :hidden').val('');
  22.  
  23.                 });
  24.                
  25.                 tabla2 = $('#tbl');
  26.                 tr2 = $('#acc', tabla2);
  27.                 $('#agregarAccion').live('click', function (){
  28.                     tr2.clone().appendTo(tabla2).find(':text, :hidden').val('');
  29.  
  30.                 }); });
  31.      
  32.             $(function(){
  33.                 $("#fecha_inicio_proyecto").datepicker({
  34.                     showOn: 'button',
  35.                     buttonImage: 'C:/Users/Sandra/Documents/NetBeansProjects/Sistema2/web/calendar.gif',
  36.                     buttonImageOnly: true,
  37.                     changeMonth:true,
  38.                     changeYear:true
  39.         });
  40.             });
  41.            
  42.         </script>
  43.        
  44.     </head>
  45.     <body>
  46.  
  47.         <h3>Ingrese la informacion del nuevo proyecto</h3> <!-- calculamos la duracion -->
  48.        
  49.         <form name="formAgregarProyecto" method="post" action="guardarProyecto.jsp">
  50.        
  51.             <table border="1">
  52.                 <tr>
  53.                     <td>
  54.                         <label for="nombre_proyecto">Nombre: </label>
  55.                             <input type="text" name="nombre_proyecto" id="nombre_proyecto" maxlength="80"/><br/>
  56.                     </td>
  57.                     <td>
  58.                         <label for="estatus_proyecto">Estatus: </label>
  59.                             <select name="estatus_proyecto" id="estatus_proyecto" size="1">
  60.                                 <option value="1">Iniciado</option>
  61.                                 <option value="2">Proceso</option>
  62.                                 <option value="3">Finalizado</option>
  63.                             </select><br/>
  64.                     </td>
  65.                 </tr>
  66.                 <tr>
  67.                     <td>
  68.                         <label for="descripcion_proyecto">Descripción:</label>
  69.                             <textarea rows="4" cols="50" name="descripcion_proyecto" id="descripcion_proyecto" maxlength="800"></textarea><br/>
  70.                     </td>
  71.                     <td rowspan="1">
  72.                         <label for="fecha_inicio_proyecto">Fecha de Inicio: </label>
  73.                             <input type="text" name="fecha_inicio_proyecto" id="fecha_inicio_proyecto" maxlength="25"  /> <br/>
  74.                         <label for="fecha_fin_proyecto">Fecha de Finalización: </label>
  75.                             <input type="text" name="fecha_fin_proyecto" id="fecha_fin_proyecto"  maxlength="15" /> <br/>
  76.                     </td>
  77.                 </tr>
  78.                 <tr>
  79.                     <td rowspan="1">
  80.                         <label for="cliente_proyecto">Cliente: </label>
  81.                             <input type="text" name="cliente_proyecto" id="cliente_proyecto" maxlength="50"/> <br/>
  82.                            
  83.                         <%  {
  84.                                 String qry1="select nombre_empresa, id_empresa from empresa";
  85.                                 ResultSet mostrarE = sql.executeQuery(qry1);
  86.                         %>
  87.                         <label for="empresa_proyecto">Empresa: </label>
  88.                             <select name="empresa_proyecto" id="empresa_proyecto" size="1">
  89.                                 <% while (mostrarE.next()) { %>
  90.                                     <option value="<%= mostrarE.getString("id_empresa") %>"><%= mostrarE.getString("nombre_empresa")%></option>
  91.                                 <% } %>
  92.                             </select><br>
  93.                         <%  
  94.                                 mostrarE.close();
  95.                              }
  96.                    
  97.                             {
  98.                                 String qry2="select id_usuario, nickname_usuario from usuario";
  99.                                 ResultSet mostrarU = sql.executeQuery(qry2);
  100.                         %>
  101.                         <label for="responsable_proyecto">Responsable: </label>
  102.                             <select name="responsable_proyecto" id="responsable_proyecto" size="1">
  103.                                 <% while (mostrarU.next()) { %>
  104.                                     <option value="<%= mostrarU.getString("id_usuario") %>"><%= mostrarU.getString("nickname_usuario") %></option>
  105.                                 <% } %>
  106.                             </select><br>
  107.                         <%  
  108.                             mostrarU.close();
  109.                             sql.close();
  110.                             conex.close();
  111.                             }
  112.                         %>
  113.                     </td>
  114.                     <td>
  115.                         <label for="observacion_proyecto">Observaciones:</label>
  116.                             <textarea rows="4" cols="50" name="observacion_proyecto" id="observacion_proyecto" maxlength="800"></textarea><br/>
  117.                     </td>
  118.                 </tr>
  119.             </table>
  120.            
  121.             <% int numero = 0; %>
  122.             <br>
  123.            
  124.             <table><tr><td>
  125.             <table id="act" border="1">
  126.                 <tr>
  127.                     <td>#</td>
  128.                     <td>Actividades</td>
  129.                     <td>Fecha de Inicio</td>
  130.                     <td>Fecha de Finalización</td>
  131.                     <td>Estatus</td>
  132.                     <td>Observacion</td>
  133.                 </tr>
  134.                
  135.                 <tr id="fila">
  136.                                        
  137.                     <td><% numero++; out.println(numero); %></td> <!-- NO SE COMO HACER Q EL NUMERO AUMENTE -->
  138.                     <td><input type="text" name="nombre_tarea[]" /></td> <!-- colocar maxlenght -->
  139.                     <td><input type="text" name="fecha_inicio_tarea[]"/></td>
  140.                     <td><input type="text" name="fecha_fin_tarea[]"/></td>
  141.                     <td><select name="estatus_tarea[]" size="1">
  142.                                 <option value="1">Iniciado</option>
  143.                                 <option value="2">Proceso</option>
  144.                                 <option value="3">Finalizado</option>
  145.                         </select></td>
  146.                     <td><input type="text" name="observacion_tarea[]"/></td>
  147.                 </tr>
  148.             </table>
  149.             </td>
  150.             <td>
  151.                 <input type="button" value="+" id="agregarFila" />
  152.             </td></tr></table>    
  153.             <!--                
  154.             <table border="1" id="tbl">
  155.                 <tr><td>Riesgo</td><td>Acción</td></tr>
  156.                 <tr id="rie">
  157.                     <td><input type="text" name="descripcion_riesgo[]" /></td>
  158.                     <td id="acc" rowspan="1"><input type="text" name="descripcion_accion[]" />
  159.                                  <input type="button" value="Agregar Accion" id="agregarAccion" /></td>
  160.                    
  161.                 </tr>
  162.                
  163.             </table>  
  164.             <input type="button" value="Agregar Riesgo" id="agregarRiesgo" />
  165.             <br>  -->
  166.             <input type="button" value="Atras" onClick="window.location.href='gestionarProyecto.jsp'" />
  167.             <input type="submit" name="Guardar" value="Guardar"  />
  168.             <input type="reset" value="Limpiar" />
  169.         </form>
  170.        
  171.     </body>
  172. </html>

Última edición por sandragh27; 14/07/2014 a las 14:17