I want to do this but dont know how to do it in JavaScript.
if (Email == "*aol.com" || Email == "*hotmail*" || Email == "*gmail*" || Email == "*yahoo*")
{
alert("No Hotmail, Gmail, Yahoo or AOL emails are allowed!");
return false;
}
Any way around this?
First, I think your searches are a bit too generic. (e.g. what if someone has the email address, “shotmail@mydomain.com“?
Try this:
I have to ask, why are you disabling people from using these email addresses? (out of interest)
Also, this really should be done on the server-side (I’m assuming you’re not using SSJS)