diff --git a/assets/script.js b/assets/script.js index 09543de..548efdc 100644 --- a/assets/script.js +++ b/assets/script.js @@ -716,14 +716,19 @@ async function surveySubmit() { const satisfaction = document.querySelector('input[name="satisfaction"]:checked'); const functionality = document.querySelector('input[name="functionality"]:checked'); const content = document.querySelector('input[name="content"]:checked'); - const comment = document.querySelector('textarea[name="comment"]').value; - if (satisfaction && functionality && content && comment) { - doAction("/survey", { + const comment = document.querySelector('textarea[name="comment"]'); + if (satisfaction && functionality && content && comment.value) { + await doAction("/survey", { action: "surveySubmit", satisfaction: satisfaction.value, functionality: functionality.value, content: content.value, - comment: comment - }); + comment: comment.value + }, "Zaznamenané", + "Nastala chyba"); + satisfaction.checked = false; + functionality.checked = false; + content.checked = false; + comment.value = ""; } } \ No newline at end of file