Design comparison
SolutionDesign
Solution retrospective
Please I need feedback on how to make the email return the error message when a wrong email is inserted. Thanks.
Community feedback
- @MOLO-7Posted over 3 years ago
Using regular expressions is probably the best way
function validateEmail(email) { const re = /^(([^<>()[\]\\.,;:\s@"]+(\.[^<>()[\]\\.,;:\s@"]+)*)|(".+"))@((\[[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}\])|(([a-zA-Z\-0-9]+\.)+[a-zA-Z]{2,}))$/; return re.test(String(email).toLowerCase()); }
Marked as helpful0@MimieveshofuoPosted over 3 years ago@MOLO-7 Thanks for the feedback. The problem I am having is returning a red border color and the error message when a wrong email is inserted.
0 - @haunguyen1064Posted over 3 years ago
Very good work! I give up when building mobile version, it was a mess. May I ask how long it takes you to finish this project?
0@MimieveshofuoPosted over 3 years ago@haunguyen1064 Thanks for the feedback. The project took me a week and some days.
0
Please log in to post a comment
Log in with GitHubJoin our Discord community
Join thousands of Frontend Mentor community members taking the challenges, sharing resources, helping each other, and chatting about all things front-end!
Join our Discord