Created
August 4, 2015 16:43
-
-
Save alexhaller/fc71f1102317eac17b73 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
jQuery(document).ready(function($) { | |
$('#registerform').find(':submit').click(function(e) { | |
if( ! isAllowedEmail( $('#user_email').val() ) ) { | |
e.preventDefault(); // Prevent the form from submitting | |
alert('You can only register with an @gmail.com email address!'); | |
return false; | |
} | |
}); | |
}); | |
function isAllowedEmail( address ) { | |
return address.indexOf("@gmail.com", this.length - 10) !== -1; | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment