Hi guys, so I'm trying to make a nutrtrion label like this: Example
You always have my db. trying to get him to work in one place at a given moment, and then do it with the rest.
My db looks like this:
ingName: .... fat: ... carbs ... etc
The problem that I have now is huge. I stuck on it for the last 3 days and no one seems to know what happened, I have a cross from an ever div that is created so that the user can delete this ingredient that he added. Therefore, if they have:
Apple : 1g Mango : 2g Melon: 3g Total : 6g
Suppose they no longer want a mango, then it should look like Apple: 1 g Mango: 2 g Total: 3g
However, I cannot get this to work. Each time I click on the cross, it removes everything and leaves nothing. Therefore, please, any help in this will be a huge help. Starting from my code with this code.
HTML:
<tr> <th colspan="2"> <b>Total Fat</b> <span id="fat">0.0</span> </th> <td> <b>22%</b> </td> </tr> <input type="text" name='search_term' id="search_term" class="searchFunction"> <input id="addButton" type="button" value="Add"> <div class="dropdown"> <ul class="result"></ul> </div> <div class="selectedStuff"></div>
My site:
http://diet.elementalbydesign.com/bootstrap-3.3.6-dist/build.php
Edit: now you see how guys only clean -1 every time I delete a div, and not the amount that I set in the database? This is a big part of the problem that I'm stuck on
source share