From 41d346d56ad2ad7b4cd758ac2bdb6fd22dbe7f6c Mon Sep 17 00:00:00 2001 From: Benjamin Date: Sat, 25 Mar 2023 09:29:47 +0100 Subject: [PATCH] Empty value of new ingredient input --- recipes/templates/recipe-form.html | 1 + 1 file changed, 1 insertion(+) diff --git a/recipes/templates/recipe-form.html b/recipes/templates/recipe-form.html index 663bb3c..ba703a1 100644 --- a/recipes/templates/recipe-form.html +++ b/recipes/templates/recipe-form.html @@ -51,6 +51,7 @@ newIngredientDiv.innerHTML = newIngredientDiv.innerHTML.replace(formRegex, `ingredient-${nextIngredientIndex}-`); form.insertBefore(newIngredientDiv, addIngredientButton); + document.querySelector("#id_ingredient-" + nextIngredientIndex + "-text").value = ""; totalIngredientFormsInput.setAttribute('value', `${nextIngredientIndex + 1}`); }