1
How can I make a form where you have a text pad of type number, and according to the number I enter appears groups of text box to fill in this same form?
Example:
Text box (number of days) = 4
<div>
<input type="date" name="data[]">
<input type="time" name="hinicio[]">
<input type="time" name="hfim[]">
</div>
<div>
<input type="date" name="data[]">
<input type="time" name="hinicio[]">
<input type="time" name="hfim[]">
</div>
<div>
<input type="date" name="data[]">
<input type="time" name="hinicio[]">
<input type="time" name="hfim[]">
</div>
<div>
<input type="date" name="data[]">
<input type="time" name="hinicio[]">
<input type="time" name="hfim[]">
</div>
Another example:
Text box (number of days) = 1
<div>
<input type="date" name="data[]">
<input type="time" name="hinicio[]">
<input type="time" name="hfim[]">
<div>
This without doing refresh to the page, and in the end send all form inckuido to day number text box I am working with php (Codeigniter)
Javascript or jquery are the most suitable candidates to solve this problem. How to make a dynamic form? and Add and Remove Fields with Javascript
– rray