Get input value to execute in the for loop

0

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>
    
asked by anonymous 22.04.2018 / 15:13

2 answers

0
  

22.04.2018 / 15:20
0

The previous code did not work, but you can solve it. I forgot to open and close {}

 for ($i = 0; $i < param1; $i++){

 }
 endfor
    
22.04.2018 / 16:42