Not Found
Not Found
Not Found
Not Found
Not Found
Not Found
Not Found
Not Found
Not Found
Not Found
Not Found
Not Found
Not Found
Not Found
Not Found
Not Found
Not Found
Not Found
Not Found
Not Found

Submitted

REACTJS rating component

Loubnakb 70

@Loubnakb

Desktop design screenshot for the Interactive rating component coding challenge

This is a solution for...

  • HTML
  • CSS
  • JS
1newbie
View challenge

Design comparison


SolutionDesign

Solution retrospective


feel free to give me your feedback

Community feedback

@javascriptor1

Posted

Hi LOUBNA,

Nice work. For the submit button, you should check first if the user selected a rating or not before you submit. Right now, If no rating is chosen, the button will submit a null value which should not happen.

Also, apply some margin between the 5 rating choices and the text on top of it.

In addition, you need to fix the active state. Give it another look.

You also should use HTML semantic tags like main for the content and footer for the footer note and alt text for the images in your design.

Hope this help.

Keep coding 🚀

1

Loubnakb 70

@Loubnakb

Posted

Hi @javascriptor1

Thank you so much for your comment, do yoou have an idea how to prevent the no rating thing please ?

0

@javascriptor1

Posted

Hi Loubna@Loubnakb ,

The logic is very simple. You have to add a check condition before you submit. Unfortunately, I don't know to work with React yet.

However, in Vanilla JS, you can add an event listener on the button and check the value of the input rating. If the value is null, you can display a message or an alert to the user. Otherwise, the button will submit.

I hope this help out. MKF

0

Please log in to post a comment

Log in with GitHub
Discord logo

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