I'm dynamically creating fields like this:
$(document).ready(function(){
$('#quantidade').on('change', function(){
var quantidade = $('#quantidade').val(),
campos = $('#campos');
campos.html(''); //aqui eu fiz limpar a div
for (x = 0; x < quantidade; x++) {
campos.append('<input type="text" id="campo-'+x+'" />');
}
});
});
However, I now do not know how to enter these fields in the database, as they will vary. I accept suggestions!