This commit is contained in:
parent
8d853a8a43
commit
c9d50b6018
@ -115,6 +115,7 @@
|
|||||||
function addProduct() {
|
function addProduct() {
|
||||||
const foodInput = document.getElementById('my_combobox');
|
const foodInput = document.getElementById('my_combobox');
|
||||||
const weightInput = document.getElementById('weight');
|
const weightInput = document.getElementById('weight');
|
||||||
|
const portionsInput = document.getElementById('portions');
|
||||||
const food = foodInput.value;
|
const food = foodInput.value;
|
||||||
let weight = parseFloat(weightInput.value);
|
let weight = parseFloat(weightInput.value);
|
||||||
const portions = Math.max(parseInt(portionsInput.value, 10), 1); // Stellt sicher, dass mindestens 1 Portion angegeben wird
|
const portions = Math.max(parseInt(portionsInput.value, 10), 1); // Stellt sicher, dass mindestens 1 Portion angegeben wird
|
||||||
@ -201,7 +202,7 @@ function updateTotalNutrition() {
|
|||||||
<input type="number" id="weight" name="weight" placeholder="Gramm" oninput="updateButtonState()">
|
<input type="number" id="weight" name="weight" placeholder="Gramm" oninput="updateButtonState()">
|
||||||
<button type="submit" id="submit-button" disabled>Hinzufügen</button>
|
<button type="submit" id="submit-button" disabled>Hinzufügen</button>
|
||||||
|
|
||||||
<input type="number" id="portions" name="portions" placeholder="Portionen" oninput="updateButtonState()" min="1" value="1">
|
<input type="number" id="portions" name="portions" placeholder="Portionen" min="1" value="1">
|
||||||
|
|
||||||
|
|
||||||
</form>
|
</form>
|
||||||
|
Loading…
x
Reference in New Issue
Block a user