Script geändert wegen seiten neustart
This commit is contained in:
parent
37a2c9b015
commit
b782d615f9
@ -184,7 +184,12 @@ document.addEventListener("DOMContentLoaded", function() {
|
|||||||
const consentCheckbox = document.getElementById("agreeConsent");
|
const consentCheckbox = document.getElementById("agreeConsent");
|
||||||
|
|
||||||
function checkAge() {
|
function checkAge() {
|
||||||
if (!birthInput.value) return;
|
if (!birthInput.value) {
|
||||||
|
consentBlock.style.display = "none";
|
||||||
|
consentCheckbox.required = false;
|
||||||
|
consentCheckbox.checked = false;
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
const birthDate = new Date(birthInput.value);
|
const birthDate = new Date(birthInput.value);
|
||||||
const today = new Date();
|
const today = new Date();
|
||||||
@ -207,6 +212,9 @@ document.addEventListener("DOMContentLoaded", function() {
|
|||||||
}
|
}
|
||||||
|
|
||||||
birthInput.addEventListener("change", checkAge);
|
birthInput.addEventListener("change", checkAge);
|
||||||
|
|
||||||
|
// 🔥 WICHTIG: Beim Laden direkt prüfen
|
||||||
|
checkAge();
|
||||||
});
|
});
|
||||||
</script>
|
</script>
|
||||||
|
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user