[Solved] Help with radio buttons on Survey Form project

Hi,

I´ve been working for the lasts days on the projects for Responsive Web Design Pages and I got stuck in the #13 test from the survey project. Maybe you could help me improve my radio buttons, so I can pass the last test of the project.

I´ve tried everything I can think of as well as checked some posts from freeCodeCamp asking for help with the radio buttons. Nothing worked :frowning:

Be aware that the page is written in Spanish, but I guess you can check the code. I´ve attached an image of the radio buttons. Here is the link as well: https://codepen.io/Lei89/full/daoBYN

Thanks,
Lai

Radio-Buttons

I’m thinking your second radio button as a typo in the name attribute. I’m guessing it should be ‘drinks’. You should also wrap your id name in double quotes, id="radio" instead of id=radio. That should help get back on track.

1 Like

Hey man, real simple fix that makes me mad whenever I do it too lol :sweat_smile:

You have to check you name attribute in your radio section to either “drinks” or “drink”! I changed the one that wasn’t plural to “drinks” and checked the test. Passed!

I also agree with @TraekWells. It’s good practice to use double quotes for HTML classes/ids/attributes (except for a few attributes that don’t need them, like height and width).
Also, looking at your HTML some more, I noticed that your radio and checkbox groups aren’t structured properly. I noticed that in your code, you don’t keep the labels wrapped around the inputs that you have for them. Instead you you end them with breaks/< br>'s. fCC’s example:

<label for="indoor"><input id="indoor" type="radio" name="indoor-outdoor">Indoor</label>
<label for="outdoor"><input id="outdoor" type="radio" name="indoor-outdoor">Outdoor</label>

You should also take a look at your responsiveness too. I think your textarea might be throwing it off when its a smaller size.

1 Like

Thank you, TraekWells! It worked. I can believe I didn´t see there was a quote missing for the id… I´ve checked it like 100 times! :tired_face:

1 Like

Thank you, pleesno :slightly_smiling_face:

I´ll check everything you comment. I just started some weeks ago to learn HTML and CSS. Actually, I know I haven´t finished to build the project, but I was wondering why it didn´t worked. At some point, I tried to wrap as labels before, but I guess I didn´t do it well. Still, I still have a lot to work on these page.

1 Like

No worries, we all gotta start somewhere. The survey is good, and works. Just gotta point it out in case, you know?