#Problem: the TD with id "email_error" does not display anything when I try to apply innerHTML text to it #My javascript below // Validation Code v2.0 (By Murdoc) function validate_form(){ var status = true; if ( user_check() == false ){ status = false; alert ("user not ok"); } if ( email_check() == false ){ status = false; document.getElementById('email_error').innerHTML = 'error'; alert ('email'); } if ( pw_check() == false ){ status = false; alert ('pw'); } if ( confirm_pw_check() == false ){ status = false; alert ('confirm pw'); } if ( vcode_check() == false ){ status = false; alert ('vcode'); } alert ('status' + status); return status; } function validate_email (email){ var regex =/^[\w\-\.\+]+\@[a-zA-Z0-9\.\-]+\.[a-zA-Z0-9]{2,3}$/; if (email.value.match(regex)){ return true; }else{ return false; } } function pw_check(){ var pw = document.getElementById('pw'); if (pw.value.length < 6 || pw.value.length > 32){ //password check document.getElementById('pw_error').innerHTML = 'Please enter a 6 - 32 character password'; return false; }else{ document.getElementById('pw_error').innerHTML =''; } } function confirm_pw_check(){ var pw = document.getElementById('pw'); var confirm_pw = document.getElementById('confirm_pw'); if (confirm_pw.value.length==0){ //Confim pw check document.getElementById('confirm_pw_error').innerHTML = 'Please re-enter the password'; return false; }else{ document.getElementById('confirm_pw_error').innerHTML =''; } if (confirm_pw.value != pw.value){//pw match check document.getElementById('confirm_pw_error').innerHTML = 'Passwords did not match'; confirm_pw.value=""; return false; } } function validate_user (uname){ var regex =/^[\w\-\.]+$/; if (uname.value.match(regex)){ return true; }else{ return false; } } function initial_focus (){ var uname = document.getElementById("user"); uname.focus(); } function user_check() { //checks if user name field is empty var uname = document.getElementById("user"); if (uname.value.length==0){//username check document.getElementById('username_error').innerHTML = 'Please enter a username'; return false; } else if (validate_user(uname)==false){ document.getElementById('username_error').innerHTML= 'you can only use: "_", "-" and "." as special characters'; return false; } //performs ajax request var ajaxRequest; try{ //FF, opera, safari ajaxRequest=new XMLHttpRequest(); } catch (e){ try{ ajaxRequest = new ActiveXObject("Msxm12.XMLHTTP"); }catch (e){ try{ ajaxRequest = new ActiveXObject("Microsoft.XMLHTTP"); }catch (e){ alert("Your broser does not support AJAX"); return false; } } } // Create a function that will receive data sent from the server ajaxRequest.onreadystatechange = function(){ if(ajaxRequest.readyState == 4){ document.getElementById('username_error').innerHTML = ajaxRequest.responseText; var msg = ajaxRequest.responseText; //alert(msg); var trueFalse; if (msg == 'Username already exists'){ trueFalse = false; }else{ trueFalse = true; } document.write(msg); return trueFalse; } } var uname=document.registration_form.user.value; var query_string = "?user=" + uname; ajaxRequest.open("GET", "lib/ajax_user_check.php" + query_string, true); ajaxRequest.send(null); } function email_check() { var status = true; var email = document.getElementById('email'); if (email.value.length==0){//Email check document.getElementById('email_error').innerHTML = 'Please enter your email address'; status = false; } else if (validate_email(email)==false){//email validation document.getElementById('email_error').innerHTML= 'please enter a valid email address'; status = false; } var ajaxRequest; try{ //FF, opera, safari ajaxRequest=new XMLHttpRequest(); }catch (e){ try { ajaxRequest = new ActiveXObject("Msxm12.XMLHTTP"); } catch (e) { try { ajaxRequest = new ActiveXObject("Microsoft.XMLHTTP"); } catch (e) { alert("Your broser does not support AJAX"); status = false; } } } // Create a function that will receive data sent from the server ajaxRequest.onreadystatechange = function(){ if(ajaxRequest.readyState == 4){ document.getElementById('email_error').innerHTML = ajaxRequest.responseText; //alert(document.getElementById('email_error').innerHTML); var msg = document.getElementById('email_error').innerHTML; if (msg == 'Email already exists. Have you forgotten your pw?') { status = false; } } } var email=document.getElementById('email').value; var query_string = "?email=" + email; ajaxRequest.open("GET", "lib/ajax_email_check.php" + query_string, true); ajaxRequest.send(null); return status; } function vcode_check() { var vcode = document.getElementById('image_code'); if (vcode.value.length==0){//Vcode check document.getElementById('vcode_error').innerHTML = 'Please enter image text'; return false; }else{ document.getElementById('vcode_error').innerHTML ='' } var ajaxRequest; try{ //FF, opera, safari ajaxRequest=new XMLHttpRequest(); }catch (e){ try { ajaxRequest = new ActiveXObject("Msxm12.XMLHTTP"); } catch (e) { try { ajaxRequest = new ActiveXObject("Microsoft.XMLHTTP"); } catch (e) { alert("Your broser does not support AJAX"); return false; } } } // Create a function that will receive data sent from the server ajaxRequest.onreadystatechange = function(){ if(ajaxRequest.readyState == 4){ document.getElementById('vcode_error').innerHTML = ajaxRequest.responseText; //alert(document.getElementById('email_error').innerHTML); var msg = document.getElementById('vcode_error').innerHTML; if (msg == 'Invalid VCode entry') { return false; } else { return true; } } } var query_string = "?vcode=" + vcode.value; ajaxRequest.open("GET", "lib/ajax_vcode_check.php" + query_string, true); ajaxRequest.send(null); } function reset_error_msg(){ document.getElementById('username_error').innerHTML =''; document.getElementById('pw_error').innerHTML =''; document.getElementById('confirm_pw_error').innerHTML =''; document.getElementById('email_error').innerHTML =''; document.getElementById('vcode_error').innerHTML =''; } #My HTML below Telephone Blacklist - Registration

Please read our terms and conditions before registering.
By submitting this form, you agree to abide by the
terms of use and services as stated.

Registration Form
* username:
* Email:
* Password:
* Re-enter password:
Location:
Allow emails from admin
image_validation();?>