function testPage() { alert("It works"); return false; } function checkEmail(field) { var str = field.value; // email string if (isValidEmail(str)) { // if syntax is valid //alert("Thank your for your feedback."); return true; } else { alert("\"" + str + "\" is not a valid e-mail address. Please check your entry and try again."); field.focus(); field.select(); return false; } } function isValidEmail(emailAddress) { var re = /^(([^<>()[\]\\.,;:\s@\"]+(\.[^<>()[\]\\.,;:\s@\"]+)*)|(\".+\"))@((\[[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}\])|(([a-zA-Z\-0-9]+\.)+[a-zA-Z]{2,}))$/; return re.test(emailAddress.trim()); }