Skip to content

Instantly share code, notes, and snippets.

@NimzyMaina
Created July 18, 2017 09:27
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save NimzyMaina/4a9036a5a83b7f86d036794f9f90b5c4 to your computer and use it in GitHub Desktop.
Save NimzyMaina/4a9036a5a83b7f86d036794f9f90b5c4 to your computer and use it in GitHub Desktop.
vaidate domain of an email
jQuery.validator.methods.email = function( value, element ) {
var email = /^([\w-.]+@(gmail|yahoo|hotmail|icloud)(\.+)?[a-zA-Z])\/?/;
return email.test(value);
}
@NimzyMaina
Copy link
Author

How to use

Simply add this before you instantiate your validator

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment