function checkForm(which, step, check, action) { if (step==0) { var requiredFields = new Array ("vorname", "name", "email", "gebdat", "kennung", "passwort", "passwort1", "adresse", "plz", "ort", "land"); if (which.zahlungsart.value=="one") requiredFields.push("telefon"); if(which.type.value=="new") { if (which.zahlungsart.value=="cbcard") { requiredFields.push("agb", "agb_cbcard", "konto_nr", "blz", "partnerkarten"); } if (which.zahlungsart.value=="maestro") requiredFields.push("agb", "agb_maestro"); if (which.zahlungsart.value=="one") requiredFields.push("agb", "agb_one"); if (which.zahlungsart.value=="kk") { requiredFields.push("agb", "agb_kk", "karten_nr", "gueltig_bis"); which.gueltig_bis.value = '01.' + which.gueltig_bis_monat.value + '.' + which.gueltig_bis_jahr.value; } requiredFields.push("agb_rueckgabe"); } } else var requiredFields = new Array(); var m_feldnamen= new Array(); m_feldnamen["vorname"] = "Vorname"; m_feldnamen["name"] = "Nachname"; m_feldnamen["email"] = "E-Mail"; m_feldnamen["gebdat"] = "Geburtsdatum"; m_feldnamen["kennung"] = "Username"; m_feldnamen["passwort"] = "Passwort"; m_feldnamen["passwort1"] = "Passwort"; m_feldnamen["adresse"] = "Straße"; m_feldnamen["plz"] = "PLZ"; m_feldnamen["ort"] = "Ort"; m_feldnamen["land"] = "Land"; m_feldnamen["telefon"] = "Telefon"; var error = 0; var field_select = 0; var field_select2 = null; var j = 0; var address_contains_streetno = false; var s; var m_b; var tempObject; var checkFilters = new Array(); checkFilters["email"] = /^([a-zA-Z0-9_\.\-])+\@(([a-zA-Z0-9\-])+\.)+([a-zA-Z0-9]{2,4})+$/; checkFilters["kennung"] = /^([^ \t\r\n\v\f;]{3,})+$/; checkFilters["passwort"] = /^([^ \t\f;]{3,})+$/; checkFilters["partnerkarten"] = /^[0-9]+$/; var checkExclude = new Array(); checkExclude ["gebdat"] = "exclude"; checkExclude ["email"] = "exclude"; checkExclude ["gueltig_bis"] = "exclude"; which.gebdat.value = which.gebtag.value + '.' + which.gebmonat.value + '.' + which.gebjahr.value; if (which.gebdat.value=="..") which.gebdat.value = ""; pass = which.passwort.value; which.step.value = step; which.action.value = action; var type = which.type.value; // A string may only be composed of letters on the terminal keyboard // , ist auch nicht erlaubt, da Befehle an den CBW-Server das als Trennzeichen verwenden! var m_allowed_letters = "1234567890abcdefghijklmnopqrstuvwxyzüöäß@/.-_ "; var m_illegal_letter = false; var m_errormsg = ''; for(i=0; i57)) { m_b = false; break; } } if (!m_b) { if (m_errormsg!='') m_errormsg+='\n'; m_errormsg+='Die BLZ ist nicht korrekt, es sind nur Ziffern erlaubt (z.B. 60000).'; if (field_select2==null) field_select2=14; } if (which.blz.value.length!=5) { if (m_errormsg!='') m_errormsg+='\n'; m_errormsg+='Die BLZ muss 5-stellig sein.'; if (field_select2==null) field_select2=14; } } if ((which.zahlungsart.value=="cbcard")&&(which.konto_nr.value!="")) { m_b = true; for (j=0; j57)) { m_b = false; break; } } if (!m_b) { if (m_errormsg!='') m_errormsg+='\n'; m_errormsg+='Die Kontonr. ist nicht korrekt, es sind nur Ziffern erlaubt (z.B. 12345678).'; if (field_select2==null) field_select2=13; } if (which.konto_nr.value.length>11) { if (m_errormsg!='') m_errormsg+='\n'; m_errormsg+='Die Kontonr. darf maximal 11-stellig sein.'; if (field_select2=="") field_select2=13; } } if (check == "y" && error==0) { for (i=0; i=48) && (tempObject.value.charCodeAt(j)<=57)) { //if (!isNaN(tempObject.value.charAt(j))) address_contains_streetno = true; break; } } if (!address_contains_streetno) { //document[imageName].src = eval(field + "_err" + ".src"); document.getElementById(imageName).style.visibility='visible'; document.getElementById(imageName).innerHTML=eval(field + "_err"); error += 1; field_select = i; } else { //document[imageName].src = eval("no_req" + ".src"); document.getElementById(imageName).style.visibility='hidden'; document.getElementById(imageName).innerHTML=''; } } else { if (tempObject.name == "gebdat") { if ((tempObject.value != "") && (!checkDate(which))) { //document[imageName].src = eval(field + "_err" + ".src"); document.getElementById(imageName).style.visibility='visible'; document.getElementById(imageName).innerHTML=eval(field + "_err"); error += 1; } else { //document[imageName].src = eval("no_req" + ".src"); document.getElementById(imageName).style.visibility='hidden'; document.getElementById(imageName).innerHTML=''; } } else if (tempObject.name == "gueltig_bis") { if ((tempObject.value != "..") && (!lib_IsDate(which.gueltig_bis.value))) { //document[imageName].src = eval(field + "_req" + ".src"); document.getElementById(imageName).style.visibility='visible'; document.getElementById(imageName).innerHTML=eval(field + "_req"); error += 1; } else { //document[imageName].src = eval("no_req" + ".src"); document.getElementById(imageName).style.visibility='hidden'; document.getElementById(imageName).innerHTML=''; } } else { //document[imageName].src = eval("no_req" + ".src"); document.getElementById(imageName).style.visibility='hidden'; document.getElementById(imageName).innerHTML=''; } } } } } } if ((error != 0)||(m_errormsg!="")) { if (field_select2==null) field_select2=-1; if ((field_select2!=-1)&&(field_select2<=field_select)) field_select=field_select2; if (m_errormsg!="") alert(m_errormsg); s = requiredFields[field_select]; if (s.indexOf('agb')==-1) { // focus auf checkbox liefert sonst fehler eval("which.field_" + requiredFields[field_select] + ".focus()"); } } else { SetFields(); if (type=="change") which.step.value = parseInt(which.step.value) + 1; which.submit(); } } function checkAGB(agb_checkbox, agb_field) { if(agb_checkbox.checked == true) { agb_field.value = "x"; } else { agb_field.value = ""; } } function focusUsername(which) { which.kennung.focus(); which.kennung.select(); } function checkNewsletter(which) { if(which.check_news.checked == true) { which.newsletter.value = "X"; } else { which.newsletter.value = ""; } } function clearField(field,str) { val = field.value; if (val.match(str) == str) field.value = ''; } function showFile(File) { window.open(File, "Info", "width=620,height=480,resizeable=yes,scrollbars=yes").focus(); } function checkDate(which) { day = which.gebtag.value; month = which.gebmonat.value; year = which.gebjahr.value; month = month - 1; var tempDate = new Date(year,month,day); if ((year == tempDate.getFullYear()) && (month == tempDate.getMonth()) && (day == tempDate.getDate())) { return true; } else { return false; } } function lib_IsDate(date) { /* check input of date field for format + validity */ filter = /^(\d{1,2})([\.\-\|\,])(\d{1,2})([\.\-\|\,])(\d{2}|\d{4})$/; control = date.match(filter); if (control == null) { /* format is not correct */ return false; } else { /* format is correct - check validity */ day = control[1]; month = control[3]; year = control[5]; if (year.length < 4) { conv_date = new Date(); year = conv_date.getFullYear().toString().substring(0,2)+year; } ctr_date = new Date(year,month-1,day) d = ctr_date.getDate(); m = parseInt(ctr_date.getMonth())+1; y = ctr_date.getFullYear(); y = y.toString().substring(y.toString().length-year.length); if (d!=day || m!=month || y!=year) { /* date is not valid */ return false; } else { /* date is valid */ return true; } } }