I have input QtdParcela
, and I want my loop to generate the data up to the value typed in input .
Here's part of my code:
In for , where 10
, I want you to receive the value that the user will type. How do I do this?
<div class="form-group col-md-3">
<label for="QtdParcela">Quantidade Parcela</label>
<input type="text" name="QtdParcela" id="QtdParcela" class="form-control">
</div>
<button type="button" id="bt_add" class="btn btn-primary">Adicionar</button>
<script>
$(document).ready(function(){
$('#bt_add').click(function(){
adicionar();
});
});
function adicionar(){
for ($i = 0; $i < 10; $i++)
endfor
}
</script>