Hi, I have a jquery code that works perfectly for me to add new inputs. The problem is that I also need to add dynamic selects for my system and I really do not understand the syntax of jquery. I would greatly appreciate your help. Certainly the select makes a query to the database.
// Añadir caja de texto.
$(container).append('<input type=text required="required" name ="fields[]" class="input" id=tb' + iCnt + ' ' +
'placeholder="Producto ' + iCnt + '" />');
<select name="producto">
<?php
$sql = "Select producto from productos";
$query = $db->prepare($sql);
$query->execute();
while($row = $query->fetch(PDO::FETCH_ASSOC)) {
echo '<option>'.$row['producto'].'</option>';
}
?>
</select>