1
Guys I have a simple form with 3 input. I need to enter a quantity in the 'Qtd' input, and with that I need jQuery to multiply the table with the form, and change the 'name'.
Example;
If I enter 3 in the input 'Qtd' will appear 3 tables with the following input: 'name1','Nome2','name3','sexo1','sexo2','sexo3'.
Does anyone know how I can do it?
<input type='text' class='form_campos' name='qtd'>
<table>
<tr>
<td>
<input type='text' class='form_campos' name='nome1'>
</td>
<td>
<input type='text' class='form_campos' name='sexo1'>
</td>
</tr>
</table>
very cool, that’s right, but could it work without having to click the enter button? I mean, as soon as I change the value it already mounts the form
– Hugo Borges
So there’s no @Hugoborges. is in the keyup/click event. I changed the input to number
– Miguel
that’s just what I want, thank you very much ;)
– Hugo Borges
Okay, take away a question? appending += is the variable that gets my form right. The problem is that the form I have here is very large, and it is difficult to put everything in 1 single line, it is difficult to maintain. how can I add html with html embedding?
– Hugo Borges
@Hugoborges, edited on top.. So it becomes more readable
– Miguel
This way you only make the append to everything in the end, it is not necessary to make once per loop inside the for that gets very heavy @Hugoborges. I’ve even simplified the code further by removing the
else
– Miguel