// JavaScript Document Formularüberprüfung




function chkFormular()
{


//Abfrage Anrede
if (document.Formular.anrede.options[0].selected == true)
{
alert("No Title selected!");
document.Formular.anrede.focus();
return false;
}	


//Abfrage Vorname
regex=/^[a-z.äöüÄÖÜéèà -.0-9]{3,32}$/i;
if(!regex.test(document.Formular.vorname.value))
{
alert("Firstname must have at least 3 and at the most 30 characters");
document.Formular.vorname.focus();
return false;
}


//Abfrage Nachname
regex=/^[a-z.äöüÄÖÜéèà -.0-9]{3,32}$/i;
if(!regex.test(document.Formular.name.value))
{
alert("Surname must have at least 3 and at the most 30 characters");
document.Formular.name.focus();
return false;
}


//Abfrage Strasse
regex=/^[a-z.äöüÄÖÜéèà -.0-9]{3,32}$/i;
if(!regex.test(document.Formular.strasse.value))
{
alert("Adress must have at least 3 and at the most 30 characters");
document.Formular.strasse.focus();
return false;
}


//Abfrage Haunummer
regex=/^[a-z.äöüÄÖÜéèà -.0-9]{1,10}$/i;
if(!regex.test(document.Formular.hausnr.value))
{
alert("Street/No must have at least 1 and at the most 10 charactersr");
document.Formular.hausnr.focus();
return false;
}


//Abfrage PLZ
regex=/^[a-z.äöüÄÖÜ -.0-9]{3,12}$/i;
if(!regex.test(document.Formular.plz.value))
{
alert("Post code must have at least 3 and at the most 10 characters");
document.Formular.plz.focus();
return false;
}


//Abfrage Ort
regex=/^[a-z.äöüÄÖÜéèà -.0-9]{3,32}$/i;
if(!regex.test(document.Formular.ort.value))
{
alert("Town code must have at least 3 and at the most 30 characters");
document.Formular.ort.focus();
return false;
}

//Abfrage E-Mail
      
regex=/^([a-z0-9_.-])+@([a-z0-9.-])+\.[a-z]{2,6}$/i;
if(!regex.test(document.Formular.email.value))
{
alert("Please fill in a valid e-mail adress in the format: user@somain.tld");
document.Formular.email.focus();
return false;
}


}

