I have the following email-validator in my javascript, but the @ is getting misinterpreted in MVC3:
function validateEmail(emailAddress) {
var emailPattern = "/^[a-zA-Z0-9._-]+@[a-zA-Z0-9.-]+\.[a-zA-Z]{2,4}$/";
return emailPattern.test(emailAddress);
}
Is there a way around this? I’ve tried using slashes to escape the at sign, but that didn’t work.
Need to get rid of the quotes. Otherwise I see no problem with it.