Design comparison
Solution retrospective
Are there any issues with my JS? How do I stop the reset button from firing when pressing enter in any of the form inputs?
Community feedback
- @legion40216Posted about 2 years ago
Good work on the project, There two easy fix regarding your problem
-
Remove the form tags The form tags have a auto refresh button when the key is pressed, So By removing the form tags this issue can be resolved. There is no need for the form tags regarding this app anyways because the data is not sent anywhere else its safe to remove it aswell
-
JS method through e.preventDefault() You have to write script by querySelecting the form element and placing onSubmit event handler and writing this function in it e.preventDefault()
btw your code is clean and well written keep it up
Marked as helpful1 -
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