missing var
All checks were successful
ci/woodpecker/push/woodpecker Pipeline was successful

This commit is contained in:
moerp 2024-04-04 12:34:51 +02:00
parent 8d853a8a43
commit c9d50b6018

View File

@ -115,6 +115,7 @@
function addProduct() {
const foodInput = document.getElementById('my_combobox');
const weightInput = document.getElementById('weight');
const portionsInput = document.getElementById('portions');
const food = foodInput.value;
let weight = parseFloat(weightInput.value);
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()">
<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>