Interactive-rating-component

Please log in to post a comment
Log in with GitHubCommunity feedback
- @jlepan
Hey!
It would be great to prevent the form from submitting and show an alert message if the user hasn't selected a rating.
For example, you could check ifratingSelected
is notnull
insidehandleSubmit
, like this:if (ratingSelected === null) { // display an alert message here (you might want to create a dedicated function!) } else { // your code if everything is okay (remember to remove the alert message if it was shown before) }
This would improve the user experience by avoiding submissions without a rating. :)
Marked as helpful
Join 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