From 24e1942cbd7bbb33689f12aebd5eaac4b5ebf5c2 Mon Sep 17 00:00:00 2001 From: Holly Date: Sun, 9 May 2021 20:35:53 +0000 Subject: [PATCH] fix installation form behaviour if run multiple times in a single load --- scripts.js | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/scripts.js b/scripts.js index 56f0d25..70ba0cb 100644 --- a/scripts.js +++ b/scripts.js @@ -1,5 +1,10 @@ // Convert each line of the textarea to a unique input element, so they're all passed with separate GET parameters function updateForm() { + // Delete old input elements in case the page hasn't been reloaded since last call + for (const oldInput of document.querySelectorAll('input[type="hidden"]')) { + oldInput.remove(); + } + form = document.getElementById("install-form"); instances = document.getElementById("instance-input").value.split("\n");