Ver Mensaje Individual
  #3 (permalink)  
Antiguo 31/03/2015, 06:47
matt_1985
 
Fecha de Ingreso: enero-2011
Ubicación: /root
Mensajes: 530
Antigüedad: 13 años, 3 meses
Puntos: 61
Respuesta: Boton crear nuevo input en formulario

Esto te podria servir:

Código Javascript:
Ver original
  1. <script type="text/javascript">
  2. var nextinput = 0;
  3. function AgregarCampos(){
  4. nextinput++;
  5. campo = '<li id="rut'+nextinput+'">Campo:<input type="text" size="20" id="campo' + nextinput + '" name="campo' + nextinput + '"&nbsp; /></li>';
  6. $("#campos").append(campo);
  7. }
  8. </script>


Código HTML:
Ver original
  1. <form id="form" name="form" method="post">
  2. <a href="#" onclick="AgregarCampos();">Agregar Campos</a>
  3. <div id="campos">

Saludos.