Name the original and newly spawned input fields ingredienten[] and benodigheden[]
this will make them come in as a array in php.
foreach($_POST['benodigheden'] as $value){
echo $value .'<br />';
}
offcourse you need to change it to something usefull
I made a example see jsfiddle here place the above php somewhere and see wat happens if you submit
changed the html form input fields
<input type="text" id="benodigheden1"name="benodigheden[]" placeholder="Benodigheden" required="required" />
<input type="text" id="ingrediënten1"name="ingrediënten[]" placeholder="Ingrediënten" required="required" />
changed the javascript by adding this line ” .attr(‘name’,res[0]+'[]’) “
// Add a line, and make it non-mandatory
$(this).clone()
.attr('id', newId).removeAttr('required')
.attr('name',res[0]+'[]')
.val('')
.insertAfter(this)
.before($('<br>'));
2
solved How to send this with php mail function