Help with Survey form

Help with Survey form
0

#1

Hey everyone

I am after some help - I am trying to pass all of the tests for the ‘Build a Survey Form’ project under the Responsive Web Design course, but I am failing on the radio button requirement. Would someone mind checking my html and let me know what I’ve done wrong please?

Here is the codepen link: https://codepen.io/Pez/pen/PBmejN

The error showing on the test suite is:

  1. Inside the form element, I can select a field from one or more groups of radio buttons. Each group should be grouped using the name attribute.

AssertionError: All your radio-buttons must have a value attribute : expected 11 to equal 6r@https://cdn.freecodecamp.org/testable-projects-fcc/v1/bundle.js:132:475

Cheers

Tom


#2
<div id="reading-time-field">
          <label id="time-reading-label" for="reading-time">How much time do you spend reading per week?</label>
          <input type="radio" name="reading-time" id="reading-time">0 to 2 hours
          <input type="radio" name="reading-time" id="reading-time">3 to 5 hours
          <input type="radio" name="reading-time" id="reading-time">6 to 10 hours
          <input type="radio" name="reading-time" id="reading-time">11 to 20 hours
          <input type="radio" name="reading-time" id = "reading-time">21 hours +
        </div>

the problem lies here, you need to have a value attribute for all your radio buttons as stated in the error report:

  • one more thing I want to point out is that id must always be unique it cant be assigned to multiple elements like a class, so in your case, all your radio buttons must have an id of their own

#3

That did the trick, thanks a lot :slight_smile:

Noted about the use of id, much appreciated.

Cheers