Survey Form - Build a Survey Form

Tell us what’s happening:
I keep getting the error of " All your checkboxes inside #survey-form should have a value attribute and value." on my html. I have switched around the names and values to where each was unique, it is currently set to where the values are unique rather than giving each input a unique name for exporting., yet my code is still giving me errors both on the fCC platform and VSCode. I’m still not sure what is wrong with it.

Your code so far

<label for="fiction"><input name="fiction" id="fiction" type="checkbox" value="interests"/>Fiction</label>
          <label for="non-fiction"><input name="non-fiction" id="non-fiction" type="checkbox" value="interests"/>Non-Fiction</label>
          <label for="fantasy"><input name="fantasy" id="fantasy" type="checkbox" value="interests"/>Fantasy</label>
          <label for="horror"><input name="horror" id="horror" type="checkbox" value="interests" />Horror</label>
          <label for="romance"><input name="romance" id="romance" type="checkbox" value="interests" />Romance</label>
          <label for="sci-fi"><input name="sci-fi" id="sci-fi" type="checkbox" value="interests"/>Sci-Fi</label>

Your browser information:

User Agent is: Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/116.0.0.0 Safari/537.36

Challenge: Survey Form - Build a Survey Form

Link to the challenge:

You need to paste all of your HTML in here, not just the part you are concerned with. There may be other issues with your HTML that are causing this error but we can’t know that unless we can see all of your HTML.

The value attributes should be unique for each checkbox. Right now you have them all the same (with the value “interests”). The value is what is passed to the server when the form is submitted. So it wouldn’t make sense for all of them to be “interests” because then you wouldn’t know which checkboxes they checked.

I’m assuming all of these check boxes are related (in other words, they are all “interests” and you can check as many as you like). If so, then the name attribute for all of them should be the same, and I’m assuming you would want that to be “interests”.

2 Likes

Welcome to the community!

For future posts, please follow @bbsmooth’s guidance? Posting all code for both the html and css assure the community can provide quick and accurate guidance.

Viewing the code you submitted, this may be the issue. But, as stated in the previous post, it could be something completely outside of this area. I suggest making the changes to the values and see if that works first. If not, then, please post the complete code?

I believe the value for each one should be the same as the id for that checkbox.

Example: <input id="washed" value="washed" type="checkbox" >

Yours currently all show the same value of interests.

You are doing great!

Happy coding!

This topic was automatically closed 182 days after the last reply. New replies are no longer allowed.