/*function validEmail() { var email_regex = /^[_A-Za-z0-9-]+(\.[_A-Za-z0-9-]+)*@[A-Za-z0-9-]+(\.[A-Za-z0-9-]+)*\.(([A-Za-z]{2,3})|(aero|coop|info|museum|name))$/; if(!email_regex.test(document.emailform.email.value)) { alert("The email address you entered is not valid."); document.emailform.email.focus(); return false; } return true; } function SubmitForm() { if ( validEmail() ) { document.emailform.submit(); } }*/ function trim(s) { while (s.substring(0,1) == ' ') { s = s.substring(1,s.length); } while (s.substring(s.length-1,s.length) == ' ') { s = s.substring(0,s.length-1); } return s; } function validEmaila(){ var txt_email = document.emailform.email; var trim_email = trim(txt_email.value); var email_regex = /^[_A-Za-z0-9-]+(\.[_A-Za-z0-9-]+)*@[A-Za-z0-9-]+(\.[A-Za-z0-9-]+)*\.(([A-Za-z]{2,3})|(aero|coop|info|museum|name))$/; if(!email_regex.test(trim_email)) { if(txt_email.value == ""){ alert("Please enter an email address."); txt_email.focus(); } else{ alert("The email address you entered is not valid."); txt_email.focus(); } return false; } return true; }