Design comparison
Community feedback
- @dnewbie25Posted over 2 years ago
Hi! This is a good project and you did a great job with the alerts when the fields are empty. The only issue is that I can still click on the "claim your free trial" button with all the fields empty, and it reloads the page without showing any warning messages. For this case, there should be an event listener for the button, so once it is clicked, it checks if the fields are empty and if the regex for the email is correct. Apart from that, everything is working great. Remember that in Javascript you might want to use
preventDefault()
when you don't want that the page gets reloaded when a form is submitted.Here's the link in case you want to give it a look: https://developer.mozilla.org/en-US/docs/Web/API/Event/preventDefault
Marked as helpful0@VinhNguyenLePosted over 2 years ago@dnewbie25 this will be very helpful for me, happy to receive your feedback
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