Last active
August 29, 2015 14:16
-
-
Save epierpont/075d899e290652fec5f9 to your computer and use it in GitHub Desktop.
JS - Simple jQuery email validation
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
// validate email address from form, good for email newsletter signup | |
$( 'form input.submit' ).click(function() { | |
var email_address = $( 'form input.email' ).val(); | |
if ( /(.+)@(.+){2,}\.(.+){2,}/.test( email_address ) ) { | |
return true; | |
} else { | |
alert( 'Invalid Email Address' ); | |
return false; | |
} | |
}); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Dear eric
This is super neat
The End