Ver Mensaje Individual
  #4 (permalink)  
Antiguo 17/12/2010, 07:56
Dany_s
 
Fecha de Ingreso: diciembre-2009
Ubicación: Misiones
Mensajes: 867
Antigüedad: 14 años, 5 meses
Puntos: 65
Respuesta: Jquery trabajar con inputs dentro de td

clona solo el tr y agregalo a la tabla, no hace falta id dinámicos

Código HTML:
Ver original
  1.     <head>
  2.         <title>Ejemplo</title>
  3.         <script src="http://ajax.googleapis.com/ajax/libs/jquery/1.4.2/jquery.min.js"></script>
  4.     </head>
  5.         <script type="text/javascript">
  6.             $( function (){
  7.                 $('#agregar').click( function(){
  8.                     newTr = $('tr:first').clone();
  9.                     $('input', newTr).val('');
  10.                     $('#laTabla').append(newTr);
  11.                     return false;
  12.                 });
  13.             });
  14.         </script>
  15.     <body>
  16.  
  17.     <div>
  18.         <table id="laTabla">
  19.             <tr>
  20.                 <td><span class="item">Name</span></td>
  21.                 <td><input  type="text"  name="nombre[]" /></td>
  22.             </tr>
  23.         </table>
  24.         <input id="agregar" type="button" value="+" />
  25.     </div>
  26.  
  27.     </body>
  28. </html>

con ese ejemplo podés agregar los td con imput que quieras y tiene que funcionar