function validate_signup(form_id,email,name,pass) { var reg = /^([A-Za-z0-9_\-\.])+\@([A-Za-z0-9_\-\.])+\.([A-Za-z]{2,4})$/; var address = document.forms[form_id].elements[email].value; var name = document.forms[form_id].elements[name].value; var pass = document.forms[form_id].elements[pass].value; if(name.length < 3) { alert('Your username must be at least 4 character'); return false; } if(pass.length < 5) { alert('Your password must be at least 6 character'); return false; } if(reg.test(address) == false) { alert('Invalid Email Address!'); return false; } tb_show('Enter security code', '#TB_inline?height=175&width=330&inlineId1=recapcha_messege&inlineId2=recaptcha_widget_div&inlineId3=security_submit', false); document.getElementById('recaptcha_response_field').focus(); document.getElementById('signup_form2submit').value = form_id; return false; //document.submitcode.submit(); } function validate_username(id, img_show){ var username = document.getElementById(id).value; xmlhttp.open("GET","ajax.php?user_exists=1&username=" + username,true); xmlhttp.send(); xmlhttp.onreadystatechange=function(){ if (xmlhttp.readyState==4 && xmlhttp.status==200) { if (xmlhttp.responseText == 'exists'){ document.getElementById(img_show).innerHTML='

'; } else{ document.getElementById(img_show).innerHTML = '

'; } } } } function validate_password(id, img_show){ var password = document.getElementById(id).value; if(password.length < 5){ document.getElementById(img_show).innerHTML='

'; } else{ document.getElementById(img_show).innerHTML='

'; } } function validate_email(id, img_show){ var reg = /^([A-Za-z0-9_\-\.])+\@([A-Za-z0-9_\-\.])+\.([A-Za-z]{2,4})$/; var email = document.getElementById(id).value; if(reg.test(email) == false){ document.getElementById(img_show).innerHTML='

'; } else{ xmlhttp.open("GET","ajax.php?email_exists=1&email=" + email,true); xmlhttp.send(); xmlhttp.onreadystatechange=function(){ if (xmlhttp.readyState==4 && xmlhttp.status==200) { if (xmlhttp.responseText == 'exists'){ document.getElementById(img_show).innerHTML='

'; } else{ document.getElementById(img_show).innerHTML = '

'; } } } } }