Código Java:
Ver original
<%@page contentType="text/html" pageEncoding="UTF-8"%> <%-- <%@include file="sesion.jsp" %> --%> <%@include file="conexion.jsp" %> <!DOCTYPE html> <html> <head> <title>Gestionar Proyecto</title> <script src="http://ajax.googleapis.com/ajax/libs/jquery/1.4.2/jquery.min.js"></script> <script type="text/javascript" src="C:/Users/Sandra/Documents/NetBeansProjects/Sistema2/web/jquery-1.7.2.min.js"></script> <script type="text/javascript" src="C:/Users/Sandra/Documents/NetBeansProjects/Sistema2/web/jquery-ui-1.10.3.custom.min.js"></script> <script type="text/javascript" src="C:/Users/Sandra/Documents/NetBeansProjects/Sistema2/web/jquery.ui.datepicker-es.js"></script> <link href="C:/Users/Sandra/Documents/NetBeansProjects/Sistema2/web/jquery-ui-1.10.3.custom.min.css" rel="stylesheet" type="text/css"> <script type="text/javascript"> $(function(){ tabla = $('#act'); tr = $('#fila', tabla); $('#agregarFila').live('click', function (){ tr.clone().appendTo(tabla).find(':text, :hidden').val(''); }); tabla2 = $('#tbl'); tr2 = $('#acc', tabla2); $('#agregarAccion').live('click', function (){ tr2.clone().appendTo(tabla2).find(':text, :hidden').val(''); }); }); $(function(){ $("#fecha_inicio_proyecto").datepicker({ showOn: 'button', buttonImage: 'C:/Users/Sandra/Documents/NetBeansProjects/Sistema2/web/calendar.gif', buttonImageOnly: true, changeMonth:true, changeYear:true }); }); </script> </head> <body> <h3>Ingrese la informacion del nuevo proyecto</h3> <!-- calculamos la duracion --> <form name="formAgregarProyecto" method="post" action="guardarProyecto.jsp"> <table border="1"> <tr> <td> <label for="nombre_proyecto">Nombre: </label> <input type="text" name="nombre_proyecto" id="nombre_proyecto" maxlength="80"/><br/> </td> <td> <label for="estatus_proyecto">Estatus: </label> <select name="estatus_proyecto" id="estatus_proyecto" size="1"> <option value="1">Iniciado</option> <option value="2">Proceso</option> <option value="3">Finalizado</option> </select><br/> </td> </tr> <tr> <td> <label for="descripcion_proyecto">Descripción:</label> <textarea rows="4" cols="50" name="descripcion_proyecto" id="descripcion_proyecto" maxlength="800"></textarea><br/> </td> <td rowspan="1"> <label for="fecha_inicio_proyecto">Fecha de Inicio: </label> <input type="text" name="fecha_inicio_proyecto" id="fecha_inicio_proyecto" maxlength="25" /> <br/> <label for="fecha_fin_proyecto">Fecha de Finalización: </label> <input type="text" name="fecha_fin_proyecto" id="fecha_fin_proyecto" maxlength="15" /> <br/> </td> </tr> <tr> <td rowspan="1"> <label for="cliente_proyecto">Cliente: </label> <input type="text" name="cliente_proyecto" id="cliente_proyecto" maxlength="50"/> <br/> <% { %> <label for="empresa_proyecto">Empresa: </label> <select name="empresa_proyecto" id="empresa_proyecto" size="1"> <% while (mostrarE.next()) { %> <option value="<%= mostrarE.getString("id_empresa") %>"><%= mostrarE.getString("nombre_empresa")%></option> <% } %> </select><br> <% mostrarE.close(); } { %> <label for="responsable_proyecto">Responsable: </label> <select name="responsable_proyecto" id="responsable_proyecto" size="1"> <% while (mostrarU.next()) { %> <option value="<%= mostrarU.getString("id_usuario") %>"><%= mostrarU.getString("nickname_usuario") %></option> <% } %> </select><br> <% mostrarU.close(); sql.close(); conex.close(); } %> </td> <td> <label for="observacion_proyecto">Observaciones:</label> <textarea rows="4" cols="50" name="observacion_proyecto" id="observacion_proyecto" maxlength="800"></textarea><br/> </td> </tr> </table> <% int numero = 0; %> <br> <table><tr><td> <table id="act" border="1"> <tr> <td>#</td> <td>Actividades</td> <td>Fecha de Inicio</td> <td>Fecha de Finalización</td> <td>Estatus</td> <td>Observacion</td> </tr> <tr id="fila"> <td><% numero++; out.println(numero); %></td> <!-- NO SE COMO HACER Q EL NUMERO AUMENTE --> <td><input type="text" name="nombre_tarea[]" /></td> <!-- colocar maxlenght --> <td><input type="text" name="fecha_inicio_tarea[]"/></td> <td><input type="text" name="fecha_fin_tarea[]"/></td> <td><select name="estatus_tarea[]" size="1"> <option value="1">Iniciado</option> <option value="2">Proceso</option> <option value="3">Finalizado</option> </select></td> <td><input type="text" name="observacion_tarea[]"/></td> </tr> </table> </td> <td> <input type="button" value="+" id="agregarFila" /> </td></tr></table> <!-- <table border="1" id="tbl"> <tr><td>Riesgo</td><td>Acción</td></tr> <tr id="rie"> <td><input type="text" name="descripcion_riesgo[]" /></td> <td id="acc" rowspan="1"><input type="text" name="descripcion_accion[]" /> <input type="button" value="Agregar Accion" id="agregarAccion" /></td> </tr> </table> <input type="button" value="Agregar Riesgo" id="agregarRiesgo" /> <br> --> <input type="button" value="Atras" onClick="window.location.href='gestionarProyecto.jsp'" /> <input type="submit" name="Guardar" value="Guardar" /> <input type="reset" value="Limpiar" /> </form> </body> </html>