I trying to create this form that only allows people to submit an email that is using a @msu.edu email. I have the alert that is coming up when it's not a msu.edu email, but when I use an email like [email protected] its not submitting the form.
function checkMail() { var email = document.validation.email.value.toLowerCase(); var filter = /^([\w-]+(?:\.[\w-]+)*)@msu.edu/i; var result = filter.test(email); alert('Valid email found: ' + result); return result; }