From a914efc011988c73695380df50d831c44b895521 Mon Sep 17 00:00:00 2001 From: Schrom01 Date: Thu, 23 Apr 2026 11:14:49 +0200 Subject: [PATCH] =?UTF-8?q?Frontend=20Validierung=20ob=20mindestens=20ein?= =?UTF-8?q?=20Ort=20und=20eine=20Rechtsform=20gew=C3=A4hlt=20wurde=20um=20?= =?UTF-8?q?leeres=20Ergebnis=20zu=20vermeiden.?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- index.php | 17 ++++++++++++++--- 1 file changed, 14 insertions(+), 3 deletions(-) diff --git a/index.php b/index.php index f084fac..15f568d 100644 --- a/index.php +++ b/index.php @@ -77,7 +77,7 @@ include "zefixAPI.php";
- +
* kann als Platzhalter verwendet werden
@@ -183,6 +183,9 @@ include "zefixAPI.php";
+ @@ -193,7 +196,15 @@ include "zefixAPI.php"; const forms = document.querySelectorAll('.needs-validation') Array.prototype.slice.call(forms).forEach(function (form) { form.addEventListener('submit', function (event) { - if (!form.checkValidity()) { + const hasSelectedSitz = document.querySelector('input[name="sitze[]"]:checked') !== null + const hasSelectedRechtsform = document.querySelector('input[name="rechtsformen[]"]:checked') !== null + const selectionValidationMessage = document.getElementById('selectionValidationMessage') + + if (selectionValidationMessage) { + selectionValidationMessage.style.display = hasSelectedSitz && hasSelectedRechtsform ? 'none' : 'block' + } + + if (!form.checkValidity() || !hasSelectedSitz || !hasSelectedRechtsform) { event.preventDefault() event.stopPropagation() } @@ -452,4 +463,4 @@ include "zefixAPI.php"; - \ No newline at end of file +