Hello.
I have a <select>
that is fed by data from the database. I need to manipulate this select and multiply it if the user wants to send two different data. Since the <option>
s depends on the data coming from the database, I do not have the option to use $(elemento).append('<select>...</select>');
I also need to change the "name" attribute of each <select>
so I can get the values correctly in $this->request->data
.
<div class="form-group">
<div class="col-lg-11">
<select class="form-control name="data[Model][0][sl_dinamica]" select-a-ser-replicada">
<option value="1">Valor 1</option>
<option value="2">Valor 2</option>
<option value="3">Valor 3</option>
</select>
<span class="btn-apagar"></span>
</div>
<div class="col-lg-1">
<span class="btn-adicionar"></span>
</div>
</div>