From cde1a10a8400f3e69e2f7d9c2e3ad91a381fd63a Mon Sep 17 00:00:00 2001 From: Andreas Hnida Date: Fri, 23 Feb 2024 07:08:02 +0000 Subject: [PATCH] $Post_[] gegen filter_input(INPUT_POST... ersetzt --- assets/js/bestellformular.js | 10 +++++++++- content/german/bestellung/freiberufliche.md | 13 +++++-------- themes/hugoplate/layouts/_default/single.html | 9 +++++---- 3 files changed, 19 insertions(+), 13 deletions(-) diff --git a/assets/js/bestellformular.js b/assets/js/bestellformular.js index 820830e..0debab5 100644 --- a/assets/js/bestellformular.js +++ b/assets/js/bestellformular.js @@ -17,11 +17,13 @@ window.onload = function () { document.getElementById('formular').addEventListener('submit', function (e) { e.preventDefault(); // Verhindert die Standard-Formularsendung + var honeyPot = document.getElementById("verify_email").value; + var endTime = Date.now(); var timeSpent = (endTime - startTime) / 1000; // Zeit in Sekunden document.getElementById("age").value = timeSpent; - document.getElementById("hobbies").value = userInteracted ? "1" : "0"; + document.getElementById("hobbies").value = userInteracted ? "true" : "false"; const form = e.target; const zsrNummer = form.elements['zsr_nummer'].value; @@ -39,6 +41,12 @@ window.onload = function () { const data = new FormData(form); const notification = document.getElementById('notification'); const btn = document.getElementById('bestellformular-btn'); + console.log("userInteracted: " + userInteracted); + console.log("timeSpent: " + timeSpent); + console.log("hobbies: " + document.getElementById("hobbies").value); + console.log("age: " + document.getElementById("age").value); + console.log("verify_email: " + honeyPot); + fetch(form.action, { method: 'POST', mode: 'cors', diff --git a/content/german/bestellung/freiberufliche.md b/content/german/bestellung/freiberufliche.md index 8cd0ee8..5e05a40 100644 --- a/content/german/bestellung/freiberufliche.md +++ b/content/german/bestellung/freiberufliche.md @@ -46,16 +46,14 @@ title = 'Freiberufliche'
- - +
- - +
@@ -70,8 +68,7 @@ title = 'Freiberufliche'
- - +
@@ -130,9 +127,9 @@ title = 'Freiberufliche'
-
+
- +
diff --git a/themes/hugoplate/layouts/_default/single.html b/themes/hugoplate/layouts/_default/single.html index cb88564..676cdaa 100755 --- a/themes/hugoplate/layouts/_default/single.html +++ b/themes/hugoplate/layouts/_default/single.html @@ -7,12 +7,13 @@ {{ if eq .Section "bestellung" }} {{ $formularjs := resources.Get "js/bestellformular.js" | minify }} -{{ $captchaSystemJS := resources.Get "vendor/captcha-system/js/main.js" | minify }} -{{ $captchaSystemCSS := resources.Get "vendor/captcha-system/css/main.css" | minify }} +{{/* TODO Captcha rauswerfen, falls wir es nicht mehr brauchen */}} +{{/* {{ $captchaSystemJS := resources.Get "vendor/captcha-system/js/main.js" | minify }} */}} +{{/* {{ $captchaSystemCSS := resources.Get "vendor/captcha-system/css/main.css" | minify }} */}} - - +{{/* */}} +{{/* */}} {{ end }} {{ end }}