Compare commits

..

No commits in common. "abe432553d2a262b91501ead1a19d6eaf3a87ea0" and "a7b78cfed44d4ddfe6dd45c848741d33812dddcb" have entirely different histories.

5 changed files with 1 additions and 46 deletions

0
dir
View File

View File

0
type
View File

0
v6.3'
View File

View File

@ -84,12 +84,6 @@
<input name="nachname" class="form-control" placeholder="Nachname" required> <input name="nachname" class="form-control" placeholder="Nachname" required>
<input type="date"
name="geburtsdatum"
class="form-control"
placeholder="Geburtsdatum"
required>
<input name="mobil" class="form-control" placeholder="Mobilnummer" required> <input name="mobil" class="form-control" placeholder="Mobilnummer" required>
<input type="email" name="email" class="form-control" placeholder="E-Mail" required> <input type="email" name="email" class="form-control" placeholder="E-Mail" required>
@ -208,7 +202,7 @@
<input class="form-check-input" <input class="form-check-input"
type="checkbox" type="checkbox"
name="agreeConsent" name="agreeConsent"
id="agreeConsent"> required>
<label class="form-check-label"> <label class="form-check-label">
Einverständnis gelesen Einverständnis gelesen
@ -282,44 +276,6 @@ function nextStep(step){
if(step === 3){ if(step === 3){
buildSummary(); buildSummary();
checkAgeAndConsent();
}
}
function checkAgeAndConsent(){
const data =
JSON.parse(localStorage.getItem('registerData'));
if(!data || !data.geburtsdatum) return;
const birth = new Date(data.geburtsdatum);
const today = new Date();
let age = today.getFullYear() - birth.getFullYear();
const m = today.getMonth() - birth.getMonth();
if (m < 0 || (m === 0 && today.getDate() < birth.getDate())) {
age--;
}
const consentBox =
document.getElementById('agreeConsent');
if(!consentBox) return;
// Unter 18 → aktiv & Pflicht
if(age < 18){
consentBox.disabled = false;
consentBox.required = true;
} else {
// Ab 18 → deaktiviert
consentBox.checked = false;
consentBox.disabled = true;
consentBox.required = false;
} }
} }
@ -430,7 +386,6 @@ function buildSummary(){
let html = ` let html = `
<b>Name:</b> ${data.vorname} ${data.nachname}<br> <b>Name:</b> ${data.vorname} ${data.nachname}<br>
<b>Geburtsdatum:</b> ${data.geburtsdatum}<br>
<b>Email:</b> ${data.email}<br> <b>Email:</b> ${data.email}<br>
<b>Mobil:</b> ${data.mobil}<br> <b>Mobil:</b> ${data.mobil}<br>
<b>Adresse:</b> <b>Adresse:</b>