var error=""; var fields=new Array("user_login"); var errorMessages=new Array(); errorMessages["user_login"]="Please enter the identifier!\n"; errorMessages["user_login_ERROR"]=false; 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_login'; if(eval(miez+'.value==""')){error+=errorMessages[miez]; errorMessages[miez+"_ERROR"]=true; } else errorMessages[miez+"_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; } } }