function absendenStichwortOK() { formAuswertung = checkForm("suchform","","stichwort","stw") return formAuswertung }; function absendenLoginOK() { formAuswertung = checkForm("loginform","","email","@","","passwort","pw") return formAuswertung }; function absendenKontaktOK() { formAuswertung = checkForm("kontaktform","","anrede","an","","vorname","txt","","nachname","txt","","email","@","","kommentar","txt") return formAuswertung }; function absendenRechnungsdatenOK() { formAuswertung = checkForm("rechnungsdaten","","firma","txt","","uid","uid","","branche","txt","","anrede","an","","vorname","txt","","nachname","txt","","zielgruppe","txt","","strasse","txt","","plz","txt","","ort","txt","","land","txt","","tel","txt","","email","@","","passwort_1","pw1","","passwort_2","pw2") return formAuswertung }; //function absendenEditRechnungsdatenOK() { // formAuswertung = checkForm('rechnungsdaten',"","anrede","an","","vorname","txt","","nachname","txt","","strasse","txt","","plz","txt","","ort","txt","","land","txt") // return formAuswertung //}; function absendenEditRechnungsdatenOK() { formAuswertung = checkForm("rechnungsdaten","","firma","txt","","uid","uid_blank","","branche","txt","","anrede","an","","vorname","txt","","nachname","txt","","strasse","txt","","plz","txt","","ort","txt","","land","txt","","tel","txt") return formAuswertung }; function absendenEditRechnungsdatenMitEmailOK() { formAuswertung = checkForm("rechnungsdaten","","firma","txt","","uid","uid_blank","","branche","txt","","anrede","an","","vorname","txt","","nachname","txt","","strasse","txt","","plz","txt","","ort","txt","","land","txt","","tel","txt","","email","@","","passwort_1","pw1","","passwort_2","pw2") return formAuswertung }; function absendenLieferdatenOK() { formAuswertung = checkForm("lieferdaten","","lieferName","txt","","lieferStrasse","txt","","lieferPlz","txt","","lieferOrt","txt") return formAuswertung }; function absendenKontodatenOK() { formAuswertung = checkForm("kontodaten","","kontoInhaber","txt","","kontoNummer","txt","","kontoBlz","txt") return formAuswertung }; function passwortdatenOK() { formAuswertung = checkForm("passwortdaten","","email","@") return formAuswertung }; function absendenBestellzusatzOK() { formAuswertung = checkForm("zusatzdaten","","kommentar","max","","agb","agb") return formAuswertung }; function uidCheck(strUidNummer,strUidLand) { strUidCheckUrl = '../../interactivist/frontend/check_uid.asp' bolUidCheckAsynchron = false; var xmlHttp = null; // Mozilla, Opera, Safari sowie Internet Explorer 7 if (typeof XMLHttpRequest != 'undefined') { xmlHttp = new XMLHttpRequest(); } if (!xmlHttp) { // Internet Explorer 6 und älter try { xmlHttp = new ActiveXObject("Msxml2.XMLHTTP"); } catch(e) { try { xmlHttp = new ActiveXObject("Microsoft.XMLHTTP"); } catch(e) { xmlHttp = null; } } } if (xmlHttp) { xmlHttp.open('POST', strUidCheckUrl, bolUidCheckAsynchron); xmlHttp.setRequestHeader("Content-Type", "application/x-www-form-urlencoded; charset=UTF-8"); xmlHttp.send('uid=' + strUidNummer + '&land='+ strUidLand); strResponseText = xmlHttp.responseText if (strResponseText=='True' || strResponseText=='true' || strResponseText=='Wahr' || strResponseText=='wahr') { return true; } else { return false; } } }; function isDigit( ch ) { if ( (ch >= '0') && (ch <= '9') ) return true; else return false; }; function isAlpha( ch ) { if ( ((ch >= 'a') && (ch <= 'z')) || ((ch >= 'A') && (ch <= 'Z')) ) return true; else return false; }; function isAlnum( ch ) { if ( isAlpha( ch ) || isDigit( ch ) ) return true; else return false; }; function notIn( str1, str2 ) { var i = 0; var j = str2.length; for( ; i '~') || !notIn( mustBeQuoted, username.charAt(0) ) ) return false; for( i=1; i '~') || !notIn ( mustBeQuoted, username.charAt(i) ) ) && ( username.charAt(i-1) != '\\' ) ) return false; } } else { if ( username.charAt( j-1 ) != '"' ) return false; for( i=1; i '9' ) ) return false; return true; }; function checkIpnr( ipnr ) { var iL=0; var iC=0; var i=0; var sNr = ""; for( ; i< ipnr.length; i++ ) { if ( ipnr.charAt(i) == '.' ) { if ( !iL || (iL> 3) || parseInt( sNr,10 ) > 255 ) return false; iC++; iL = 0; sNr = ""; continue; } if ( isDigit ( ipnr.charAt(i) ) ) { iL++; sNr = sNr + ipnr.charAt(i); continue; } return false; } if ( parseInt( sNr,10 ) > 255 ) return false; if ( ( (iC==3) && (iL>=1) && (iL<=3) ) || ( (iC==4) && (!iL) ) ) return true; else return false; }; function checkFqdn( fqdn ) { var iL=0; var iC=0; var i=fqdn.length-1; if ( (fqdn.charAt(0) == '.') || (fqdn.charAt(0) == '-') ) return false; if ( fqdn.charAt(i) == '.' ) i=i-1; for( ; i>=0; i-- ) { if ( fqdn.charAt(i) == '.' ) { if ( iL < 2 && iC < 2 ) return false; if ( fqdn.charAt(i-1) == '-' ) return false; iC++; iL = 0; continue; } if ( isAlnum ( fqdn.charAt(i) ) ) { iL++; continue; } if ( fqdn.charAt(i) == '-' ) { if ( !iL ) return false; iL++; continue; } return false; } if ( !iC || ( iL == 1 && iC < 2 ) || ( !iL && iC==1 ) ) { return false; } return true; }; function checkHostname( hostname ) { if ( hostname.charAt(0) == '[' ) { if ( hostname.charAt(hostname.length-1) != ']' ) return false; var ipnr = hostname.substring( 1, hostname.length -1 ); return checkIpnr( ipnr ); } if ( hostname.charAt(0) == '#' ) { var nr = hostname.substring( 1, hostname.length ); return checkNr( nr ); } // edited by interact var seperate = hostname.lastIndexOf("."); if ( seperate == -1 ) return false; tld = hostname.substring(seperate+1, hostname.length ); if ((tld.length > 6 )) return false; if ((tld.length > 4 )) { return confirm("" + tld + ""); } return checkFqdn( hostname ); }; function checkEmailAdr( address ) { var status = true; var username = ""; var hostname = ""; if ( address.length < 8 ) return false; var seperate = address.lastIndexOf("@"); if ( seperate == -1 ) return false; username = address.substring(0, seperate ); if ( ! checkUsername( username, "<>!$%&/=?`*~+'#|^()[],;:@\" " ) ) return false; hostname = address.substring(seperate+1, address.length ); if ( ! checkHostname( hostname ) ) return false; if ((address.indexOf('..')) > -1 || (address.indexOf('.@')) > -1 || (address.indexOf('\\')) > -1 ) return false; return true; }; function checkEmail( email, allowFullname ) { var existFullname = false; var status = true; var fullname = ""; var adress = ""; if ( email.length < 8 ) return false; var emailBegin = email.indexOf("<"); var emailEnd = email.lastIndexOf(">"); if ( (emailBegin == -1) && (emailEnd == -1) ) return checkEmailAdr( email ); if ( ( (emailBegin == -1) && (emailEnd != -1) ) || ( (emailBegin != -1) && (emailEnd == -1) ) ) return false; adress = email.substring( emailBegin+1, emailEnd ); if ( ! checkEmailAdr( adress ) ) return false; if ( email.length == adress.length + 2 ) return true; else if ( ! allowFullname ) return false; if ( emailEnd == email.length - 1 ) { if ( emailBegin == 0 ) return true; if ( email.charAt( emailBegin -1 ) != ' ' ) return false; fullname = email.substring( 0, emailBegin-1 ); return checkUsername ( fullname, "<>!$%&/=?`*~+'#|^()[],;:@\" " ); } return false ; }; function checkForm() { checkFormValue=true parameter=checkForm.arguments parameter_anzahl=parameter.length formularname=parameter[0] fehler='' + ':\n\n' for (i=1; i<(parameter_anzahl-2); i+=3) { feedbackTitel=parameter[i] feldname=parameter[i+1] eval('feldinhalt=document.' + formularname + '.' + feldname + '.value'); switch (parameter[i+2]) { case 'txt': if (trim(feldinhalt).length < 1) { //fehler+=(' - ' + feedbackTitel + '' +' \n') fehler+=(' - ' + feedbackTitel +'\n') checkFormValue=false; } break; case 'max': if (trim(feldinhalt).length > 200) { //fehler+=(' - ' + feedbackTitel +' bitte korrekt angegeben!\n') fehler+=(' - Das Feld ' + feedbackTitel + '' + ' \n') checkFormValue=false; } break; case 'stw': if (trim(feldinhalt).length < 3) { fehler+=(' - Bitte im Feld ' + feedbackTitel + '' + ' \n') checkFormValue=false; } break; case 'one': if (trim(feldinhalt).length < 1) { //fehler+=(' - ' + feedbackTitel + '' +' \n') fehler+=(' - ' + feedbackTitel +'\n') checkFormValue=false; } break; case 'pw': if ((trim(feldinhalt).length < 4) || (feldinhalt=='')) { fehler+=('' +' \n') checkFormValue=false; } break; case 'pw1': if (trim(feldinhalt).length < 4) { fehler+=('' +' \n') checkFormValue=false; } else { //Passwort2 feedbackTitel2=parameter[i+3] feldname=parameter[i+4] eval('feldinhalt2=document.' + formularname + '.' + feldname + '.value'); if (feldinhalt != feldinhalt2) { fehler+=('' +' \n') checkFormValue=false; } } break; case '@': if (checkEmail(feldinhalt, true ) == false) { fehler+=('' +' \n') checkFormValue=false; } break; case 'an': if (feldinhalt=='?' || feldinhalt=='') { fehler+=('' + ' \n') checkFormValue=false; } break; case 'uid': //if (feldinhalt !=='') { strUidCheck = uidCheck(feldinhalt,document.rechnungsdaten.land.value) if (strUidCheck != true) { fehler+=('' + ' \n') checkFormValue=false; } //} break; case 'uid_blank': if (feldinhalt !='') { strUidCheck = uidCheck(feldinhalt,document.rechnungsdaten.land.value) if (strUidCheck != true) { fehler+=('' + ' \n') checkFormValue=false; } } else { } break; case 'agb': eval('feldinhalt = document.' + formularname + '.' + feldname + '.checked') if (feldinhalt != true) { fehler+=(' - ' + feedbackTitel + '' + ' \n') checkFormValue=false; } } } if (checkFormValue==false) { alert(fehler) } return checkFormValue; };