diff --git a/assets/script.js b/assets/script.js index 72c45d6..6df4457 100644 --- a/assets/script.js +++ b/assets/script.js @@ -549,6 +549,7 @@ if ("loading" === document.readyState) { async function uploadFile() { const fileInput = document.getElementById('fileInput'); + const fileForm = document.getElementById('uploadForm'); let data = { action: "uploadFiles" }; @@ -556,7 +557,7 @@ async function uploadFile() { data[`userFile${i}`] = fileInput.files[i]; } await doAction("/upload", data, "Súbor bol úspešne nahraný", "Nastala chyba pri nahrávaní súboru", false); - fileInput.reset(); + fileForm.reset(); } async function deleteFile(fileID) { @@ -590,6 +591,7 @@ async function addMeme() { let memeTitleElement = document.getElementById("meme_title_input"); let memeTextElement = document.getElementById("meme_text_input"); let memeImageElement = document.getElementById("meme_image_input"); + let memeFormElement = document.getElementById("memeAddForm"); await doAction("/meme", { action: "addMeme", @@ -597,9 +599,7 @@ async function addMeme() { meme_text: memeTextElement.value, meme_image_id: memeImageElement.value }, "Meme bol zmazaný", "Nastala chyba pri mazaní meme-u", false); - memeTitleElement.reset(); - memeTextElement.reset(); - memeImageElement.reset(); + memeFormElement.reset(); } async function deleteMeme(memeId) { diff --git a/pages/memes/create.html b/pages/memes/create.html index 0173318..655c383 100644 --- a/pages/memes/create.html +++ b/pages/memes/create.html @@ -1,9 +1,11 @@ - - - - - - - \ No newline at end of file +
+ + + + + + + +
\ No newline at end of file