· 8 years ago · Feb 26, 2018, 04:40 AM
1jQuery(document).ready(function($) {
2 $('#registerform').find(':submit').click(function(e) {
3 if( ! isGmail( $('#user_email').val() ) ) {
4 e.preventDefault(); // Prevent the form from submitting
5 alert('You can only register with an @gmail.com email address!');
6 return false;
7 }
8 });
9});
10
11function isGmail( address ) {
12 return address.indexOf("@gmail.com", this.length - 10) !== -1;
13}