-1
How best to create dynamic fields in the view ?
Suppose I need to create several products in the register and mention the type of product or category.
I’m using it this way:
<form action="" method="POST" enctype="multipart/form-data">
<div class="form-group col-md-6">
<div class="input-group">
<input type="produto" class="form-control" value="" id="produto" name="produto[]"
placeholder="Nome do Produto">
<select class="form-control select2" name="categoria[]" style="width: 100%;">
<option value="" selected="">Selecione</option>
<option value="1">Categoria 1</option>
<option value="2">Categoria 2</option>
</select>
</div>
</div>
<button type="submit">Enviar</button>
</form>
I’m having trouble capturing this in Controller ? I need to "match" the data of each product with the chosen category.
Does anyone have an example ?
Qual a melhor forma de criar campos dinâmicos na View?
A: the answer is a reactive framework (angular
,vue
orreactjs
)– novic
Only with HTML5 ?
– Eder Ferreira