var error=""; var fields=new Array("user_lastname", "user_firstname", "user_phone", "user_email", "user_address_zip", "user_address_city", "user_address_street", "user_login","user_pass","user_pass2","user_email"); var errorMessages=new Array(); errorMessages["user_lastname"]="Give me your last name.\n"; errorMessages["user_lastname_ERROR"]=false; errorMessages["user_firstname"]="Give me your first name.\n"; errorMessages["user_firstname_ERROR"]=false; errorMessages["user_phone"]="Give me the phone number!\n"; errorMessages["user_phone_ERROR"]=false; errorMessages["user_email"]="Enter your e-mail address!\n"; errorMessages["user_email_ERROR"]=false; errorMessages["user_address_zip"]="Enter your postcode!\n"; errorMessages["user_address_zip_ERROR"]=false; errorMessages["user_address_city"]="Give me the city!\n"; errorMessages["user_address_city_ERROR"]=false; errorMessages["user_address_street"]="Enter the street and the house number!\n"; errorMessages["user_address_street_ERROR"]=false; errorMessages["user_login"]="Please enter the identifier!\n"; errorMessages["user_login_ERROR"]=false; errorMessages["user_pass"]="Please enter your password.\n"; errorMessages["user_pass_ERROR"]=false; errorMessages["user_pass2"]="Please enter your password verification!\n"; errorMessages["user_pass2_ERROR"]=false; errorMessages["user_pass_nemegyezik"]="The passwords do not match!\n"; errorMessages["user_pass_hibas"]="The password can only contain upper and lower case letters and numbers!\n"; errorMessages["user_pass_hossz"]="The password must be at least 5 characters and up to 20 characters long!\n"; errorMessages["user_login_hibas"]="The identifier can only contain upper and lower case letters and numbers!\n"; errorMessages["user_login_hossz"]="The identifier can be a minimum of 5 and a maximum of 20 characters long!\n"; function formsubmit(){ checkErrors(); if(error==""){ with(document.forms.pageform){ submit(); FRM_SUBMIT.value="Sending in progress..."; FRM_SUBMIT.disabled=true; } } else { showErrors(fields,errorMessages); alert(form_format_alert_text(error+"Thank you!")); } } function checkErrors(){ error=""; with(document.forms.pageform){ miez='user_lastname'; if(eval(miez+'.value==""')){error+=errorMessages[miez]; errorMessages[miez+"_ERROR"]=true; } else errorMessages[miez+"_ERROR"]=false; miez='user_firstname'; if(eval(miez+'.value==""')){error+=errorMessages[miez]; errorMessages[miez+"_ERROR"]=true; } else errorMessages[miez+"_ERROR"]=false; miez='user_phone'; if(eval(miez+'.value==""')){error+=errorMessages[miez]; errorMessages[miez+"_ERROR"]=true; } else errorMessages[miez+"_ERROR"]=false; /* miez='user_email'; if(eval(miez+'.value==""')){error+=errorMessages[miez]; errorMessages[miez+"_ERROR"]=true; } else errorMessages[miez+"_ERROR"]=false; */ miez='user_address_zip'; if(eval(miez+'.value==""')){error+=errorMessages[miez]; errorMessages[miez+"_ERROR"]=true; } else errorMessages[miez+"_ERROR"]=false; miez='user_address_city'; if(eval(miez+'.value==""')){error+=errorMessages[miez]; errorMessages[miez+"_ERROR"]=true; } else errorMessages[miez+"_ERROR"]=false; miez='user_address_street'; if(eval(miez+'.value==""')){error+=errorMessages[miez]; errorMessages[miez+"_ERROR"]=true; } else errorMessages[miez+"_ERROR"]=false; miez='user_login'; if(eval(miez+'.value==""')){error+=errorMessages[miez]; errorMessages[miez+"_ERROR"]=true; } else errorMessages[miez+"_ERROR"]=false; miez='user_pass'; if(eval(miez+'.value==""')){error+=errorMessages[miez]; errorMessages[miez+"_ERROR"]=true; } else errorMessages[miez+"_ERROR"]=false; miez='user_pass2'; if(eval(miez+'.value==""')){error+=errorMessages[miez]; errorMessages[miez+"_ERROR"]=true; } else errorMessages[miez+"_ERROR"]=false; miez='user_email'; if(eval(miez+'.value==""')){error+=errorMessages[miez]; errorMessages[miez+"_ERROR"]=true; } else if(eval('!is_email('+miez+'.value)')){error+=errorMessages[miez]; errorMessages[miez+"_ERROR"]=true; } else errorMessages[miez+"_ERROR"]=false; if(error==''){ if(user_pass.value!=user_pass2.value){error+=errorMessages["user_pass_nemegyezik"]; errorMessages["user_pass_ERROR"]=true; errorMessages["user_pass2_ERROR"]=true; } else {errorMessages["user_pass_ERROR"]=false; errorMessages["user_pass2_ERROR"]=false;} } if(error==''){ if(user_pass.value.length<5 || user_pass.value.length>20) {error+=errorMessages["user_pass_hossz"]; errorMessages["user_pass_ERROR"]=true; } else if(user_pass.value.match(/[^0-9a-zA-Z]/)) {error+=errorMessages["user_pass_hibas"]; errorMessages["user_pass_ERROR"]=true; } else errorMessages["user_pass_ERROR"]=false; } if(error==''){ if(user_login.value.length<5 || user_login.value.length>20) {error+=errorMessages["user_login_hossz"]; errorMessages["user_login_ERROR"]=true; } else if(user_login.value.match(/[^0-9a-zA-Z]/)) {error+=errorMessages["user_login_hibas"]; errorMessages["user_login_ERROR"]=true; } else errorMessages["user_login_ERROR"]=false; } } }