Answer the question
In order to leave comments, you need to log in
How to get all list of data from all input?
Hello! There was a need to connect a calorie calculator on the wife’s website, but then a snag arose, how now to get all the data from the filled inputs in one list. You need to output all the specified ingredients in a separate DIV block, so that each ingredient is separated by a comma.
There is a block where the ingredient is added, in block 3 input, in the 1st we enter the ingredient "tomato", in the 2nd we indicate the weight "2", and in the 3rd unit of measurement "pcs". It turns out as a result "Tomato 2 pcs."
Each new line with new input fields is formed in this way:
<div class="form-box-cont">
<div class="form-box-ingrid">
<input type="text" placeholder="Название ингредиента" id="ingred2" name="ingred_group[1][ingredient][2][name]" value="">
</div>
<div class="form-box-inp">
<input type="text" placeholder="Кол-во" name="ingred_group[1][ingredient][2][value]" value="">
<input type="text" placeholder="Ед.Изм." id="unit2" name="ingred_group[1][ingredient][2][unit]" value="">
</div>
</div>
Answer the question
In order to leave comments, you need to log in
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question