190 lines
5.0 KiB
JavaScript
190 lines
5.0 KiB
JavaScript
document.getElementById("registrierenKnopf").addEventListener('click', function (){
|
|
var vorName = document.getElementById("vorName").value;
|
|
var nachName = document.getElementById("nachName").value;
|
|
var strasse = document.getElementById("strasse").value;
|
|
var hausNummer = document.getElementById("hausNummer").value;
|
|
var plz = document.getElementById("postleitzahl").value;
|
|
var ort = document.getElementById("ort").value;
|
|
var email = document.getElementById("email").value;
|
|
var emailRep = document.getElementById("emailRep").value;
|
|
var passwort = document.getElementById("passwort").value;
|
|
var passwortRep = document.getElementById("passwortRep").value;
|
|
|
|
|
|
//document.getElementById("datenSchutzHinweisRegistrierung").innerHTML = "Vorname: " + vorName + " nachName :" + nachName + " strasse: " + strasse + " hausNummer: " + hausNummer + " plz: " + plz + " ort: " + ort + " email: " + email + " emailRep: " + emailRep + " passwort: " + passwort + " passwortRep: " + passwortRep
|
|
|
|
|
|
|
|
function checkVorName(vorName){
|
|
var listOfErrors = [];
|
|
if (vorName.length <2){
|
|
listOfErrors[listOfErrors.length] = ("Zu Kurz, muss mindestens 2 Buchstaben haben.") ;
|
|
}
|
|
if (vorName.match(/\d+/g) != null){
|
|
listOfErrors[listOfErrors.length] = ("Unerlaubtes Zeichen, darf keine Zahlen beinhalten.");
|
|
}
|
|
|
|
if (listOfErrors[0] == null) {
|
|
return true;
|
|
}
|
|
return listOfErrors;
|
|
}
|
|
|
|
function checkNachName (nachName){
|
|
var listOfErrors = [];
|
|
//TBI Überprüfung
|
|
return listOfErrors;
|
|
}
|
|
|
|
function checkStrasse (strasse){
|
|
var listOfErrors = [];
|
|
//TBI Überprüfung
|
|
return listOfErrors;
|
|
}
|
|
|
|
function checkHausnummer (hausNummer){
|
|
var listOfErrors = [];
|
|
//TBI Überprüfung
|
|
return listOfErrors;
|
|
}
|
|
|
|
function checkPlz (plz){
|
|
var listOfErrors = [];
|
|
//TBI Überprüfung
|
|
return listOfErrors;
|
|
}
|
|
|
|
function checkOrt (ort){
|
|
var listOfErrors = [];
|
|
//TBI Überprüfung
|
|
return listOfErrors;
|
|
}
|
|
|
|
function checkPasswort (passwort){
|
|
var listOfErrors = [];
|
|
//TBI Überprüfung
|
|
return listOfErrors;
|
|
}
|
|
|
|
function checkPasswortRep (passwortRep){
|
|
var listOfErrors = [];
|
|
//TBI Überprüfung
|
|
return listOfErrors;
|
|
}
|
|
|
|
var errors = []
|
|
|
|
var errorVorName = checkVorName(vorName);
|
|
var errorNachName = checkNachName(nachName);
|
|
var errorStrasse = checkStrasse(strasse);
|
|
var errorHausnummer = checkHausnummer(hausNummer);
|
|
var errorPlz = checkPlz(plz);
|
|
var errorOrt = checkOrt(ort);
|
|
var errorPasswort = checkPasswort(passwort);
|
|
var errorPasswortRep = checkPasswortRep(passwortRep);
|
|
|
|
if (!(typeof errorVorName == "boolean")){
|
|
var errorVorNameString = "Vorname:<br>" + errorVorName.join("<br>")
|
|
}
|
|
errors[errors.length] = errorVorNameString;
|
|
|
|
if (!(typeof errorNachName == "boolean")){
|
|
var errorNachNameString = "Nachname:<br>" + errorNachName.join("<br>")
|
|
}
|
|
errors[errors.length] = errorNachNameString;
|
|
|
|
if (!(typeof errorStrasse == "boolean")){
|
|
var errorStrasseString = "Straße:<br>" + errorStrasse.join("<br>")
|
|
}
|
|
errors[errors.length] = errorStrasseString;
|
|
|
|
if (!(typeof errorHausnummer == "boolean")){
|
|
var errorHausnummerString = "Hausnummer:<br>" + errorHausnummer.join("<br>")
|
|
}
|
|
errors[errors.length] = errorHausnummerString;
|
|
|
|
if (!(typeof errorPlz == "boolean")){
|
|
var errorPlzString = "Postleitzahl:<br>" + errorPlz.join("<br>")
|
|
}
|
|
errors[errors.length] = errorPlzString;
|
|
|
|
if (!(typeof errorOrt == "boolean")){
|
|
var errorOrtString = "Ort:<br>" + errorOrt.join("<br>")
|
|
}
|
|
errors[errors.length] = errorOrtString;
|
|
|
|
if (!(typeof errorPasswort == "boolean")){
|
|
var errorPasswortString = "Passwort:<br>" + errorPasswort.join("<br>")
|
|
}
|
|
errors[errors.length] = errorPasswortString;
|
|
|
|
if (!(typeof errorPasswortRep == "boolean")){
|
|
var errorPasswortRepString = "Passwort bestätigen:<br>" + errorPasswortRep.join("<br>")
|
|
}
|
|
errors[errors.length] = errorPasswortRepString;
|
|
|
|
|
|
if (errors.length === 0){
|
|
window.open("registrierungErfolgreich.html", "_self")
|
|
} else {
|
|
document.getElementById("vorName").value = vorName;
|
|
document.getElementById("nachName").value = nachName;
|
|
document.getElementById("strasse").value = strasse;
|
|
document.getElementById("hausNummer").value = hausNummer;
|
|
document.getElementById("postleitzahl").value = plz;
|
|
document.getElementById("ort").value = ort;
|
|
document.getElementById("email").value = email;
|
|
document.getElementById("emailRep").value = emailRep;
|
|
document.getElementById("passwort").value = passwort;
|
|
document.getElementById("passwortRep").value = passwortRep;
|
|
document.getElementById("registrierungFehler").innerHTML = errors.join("<br>");
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
}); |