Submitted almost 2 years ago
Responsive Intro component with sign-up form using HTML CSS & JS
@ShubhPatel06
Design comparison
SolutionDesign
Solution retrospective
Was unable to implement the JS part for checking emails. Any feedback will be highly appreciated.
Community feedback
- @KonstantinchristPosted almost 2 years ago
Hello @ShubhPatel06, I like your project, but I highly advise you to use patterns for the email validation instead of the bulit in required tool.
Example:
const emailPattern = /^[a-z0-9._%+-]+@[a-z0-9.-]+\.[a-z]{2,4}$/; if (emailInput.value.match(emailPattern){ // email valid } else{ // email not valid }
If you use this way of email validation, you can give the error at the inputs also if the field is not empty, but the email is not valid. Such patterns exist for everything (e.g. phone number).
Hope it helps!
Marked as helpful0
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