From 326ef423af97ab4c5ce40c6decaafa7154bd2019 Mon Sep 17 00:00:00 2001 From: Yannik Schmidt Date: Thu, 10 Sep 2020 23:57:35 +0200 Subject: [PATCH] fix contact form missing fields --- static/contact.js | 14 ++++++++++++++ templates/contact.html | 5 +++-- 2 files changed, 17 insertions(+), 2 deletions(-) diff --git a/static/contact.js b/static/contact.js index 2d96acf..9cf9de0 100644 --- a/static/contact.js +++ b/static/contact.js @@ -1,5 +1,19 @@ function submitContactForm(){ + /* check input fields */ + mailField = document.getElementById("email") + messageField = document.getElementById("message") + + if(mailField.value == ""){ + alert("Bitte geben Sie einen Kontakt an unter dem wir Sie erreichen können!") + return + } + + if(messageField.value == ""){ + alert("Nachricht ist leer!") + return + } + /* show the waiting dialog */ dialog = document.getElementById("waiting-dialog") dialog.style.disply = "block" diff --git a/templates/contact.html b/templates/contact.html index a743902..77797ef 100644 --- a/templates/contact.html +++ b/templates/contact.html @@ -67,9 +67,10 @@