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

Interactive rating component

P

@francimelink

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


Hi,

I used absolute distances and sizes in the solution. Instead of a form and radio buttons, I made a simple list, which I then designed. Not the cleanest solution, but with the form I had problems with the design of the radio buttons.

Any help how to properly desin radio buttons when they are selected will be very helpful to me.

Thank you

Community feedback

@VCarames

Posted

Hey there! 👋 Here are some suggestions to help improve your code:

  • The “icons/illustrations” in this component serve no other purpose than to be decorative; They add no value. There alt tag should be left blank and have an aria-hidden=“true” to hide them from assistive technology.

More Info:📚

https://www.w3.org/WAI/tutorials/images/

  • The proper way to build the "rating buttons" in this challenge is to create a form and inside of it, there should be fiveinput radios and each input should have a label attached to it to make the buttons accessible. Finally wrap all the inputs and labels inside a fieldset to prevent users from making more than one selection.

More Info:📚

MDN <input type="radio">

MDN <fieldset>: The Field Set element

If you have any questions or need further clarification, feel free to reach out to me.

Happy Coding!🎄🎁

Marked as helpful

0
Adriano 36,650

@AdrianoEscarabote

Posted

Hello Franci Melink, how are you? Welcome to the community of front-end mentors! I truly loved your project's outcome, however I have some advice that I hope you'll find useful:

To make the submit button work only when the user selects a number, we can do this:

for (let index = 0; index < ratingRates.length; index++) {
    ratingRates[index].addEventListener('click', function () {
        selectedRateIndex = index + 1;
        for (const rate of ratingRates) {
            rate.classList.remove('active');
        }
        this.classList.add('active');
        submitButton.addEventListener('click', function () {
            ratingSec.style.display = 'none';
    	    thankSection.style.display = 'flex';

            let thankRate = thankSection.querySelector('.thank__rate');
            thankRate.textContent = selectedRateIndex;
        });
    })
}

The remainder is excellent.

I hope it's useful. 👍

Marked as helpful

0
Roy 600

@arkaroy135

Posted

Hello Franci, Hope you are doing well. You did fantastic job in this project, perfect design. I have one thing to add here, that use cursor: pointer; on the submit button.

0

P

@francimelink

Posted

@arkaroy135

thank you. I was focused on rates and forgot about sumbit....

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