Design comparison
Solution retrospective
Hi everyone. I need to fix my email validation... it doesn't work properly. Has someone an idea how to do it? Thanks :)
Community feedback
- @mattstuddertPosted about 5 years ago
Hey, nice work on this project! What is it specifically that you're having issues with on the form validation? Everything worked fine for me when filling it in.
0@mstankaPosted about 5 years ago@mattstuddert Hi Matt, thank you! Actually, it works. The only issue is that the form can be submitted with an empty input.
0@mattstuddertPosted about 5 years ago@mstanka ah OK, have a look again this expression on line 18:
(regEx.test(emailValue) !== true || emailValue === 0)
. For the second part you'd need to checkemailValue.length
against the number 0, notemailValue
, as that would just be an empty string if theinput
is empty. Or you could shorten it to(regEx.test(emailValue) !== true || !emailValue)
.Hope that helps!
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