Last active
August 14, 2018 08:24
-
-
Save Crocmagnon/ee68c2c18c2c3b7a85730b319743c354 to your computer and use it in GitHub Desktop.
Crappy email check. Don't do this at home !
This file contains hidden or 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
| var regexEmail = /^\w+([\.-]?\w+)*@\w+([\.-]?\w+)*(\.\w{2,3})+$/; | |
| if(email == '' || !regexEmail.test(email)){ | |
| $('.edit_data input[name="customer[email]').after("<p class='form-error'>Merci de renseigner un email correct</p>"); | |
| return false; | |
| } |
Author
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
You'll quickly notice that only 2-3 characters TLD work. All with 4 characters and up will throw the error.