0
I have the input QtdParcela
, and I want my loop generates data up to the value entered in input.
Follow part of my code:
In the for, where is 10
, I want you to receive the value that the user will enter. 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>
In that case you don’t use the
endfor
! Keys already delimit the loop...– LipESprY