Radio Button and Checkboxes

Please someone help me! I have been working on this webpage all day, and I cannot get the tests to pass. I need you to look at the section that has the two radio buttons and three checkboxes. I keep receiving a message that says “one of your radio buttons should have the value attribute of [blank].” I just need you to tell me what this code is exactly supposed to look like.

<p>Click here to view more <a href="#">cat photos</a>.</p>

<a href="#"><img src="" alt="A cute orange cat lying on its back."></a>

<p>Things cats love:</p>
  <li>cat nip</li>
  <li>laser pointers</li>
<p>Top 3 things cats hate:</p>
  <li>flea treatment</li>
  <li>other cats</li>
<form action="/submit-cat-photo">
  <label for="indoor"><input value="indoor" type="radio" name="indoor">indoor</label>
  <label for="outdoor"><input value="outdoor" type="radio" name="outdoor">outdoor</label><br>
  <label for="loving"><input value="loving" type="checkbox" name="loving">loving</label>
  <label for="lazy"><input value="lazy" type="checkbox" name="lazy">lazy</label>
  <label for="energetic"><input value="energetic" type="checkbox" name="energetic">energetic</label><br>
  <input type="value" placeholder="cat photo URL" required>
  <button type="submit">Submit</button>

Your browser information:

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

Challenge: Use the value attribute with Radio Buttons and Checkboxes

Link to the challenge:

We won’t give you the answer, but we can help you fix your code.

I’ve edited your post for readability. When you enter a code block into a forum post, please precede it with a separate line of three backticks and follow it with a separate line of three backticks to make it easier to read.

You can also use the “preformatted text” tool in the editor (</>) to add backticks around text.

See this post to find the backtick on your keyboard.
Note: Backticks (`) are not single quotes (’).

It looks like you changed the value of the input label text. For example, look at the original code:

    <label><input type="checkbox" name="personality"> Energetic</label><br>

You want to leave the input label text Energetic as it is and add the value attribute as energetic.

I do not understand how to add the value attribute as energetic. Do you mean that somewhere within the input element I need to have the assignment value= “energetic”? Is this the only thing I am supposed to add to the preexisting code you posted for me as reference? I need to know what you mean.

Thank you for helping me. You are my only hope at this point.

Try it T, it’s a good start :slight_smile:

Right, the only thing the challenge is asking for is adding the ‘value’ s. You don’t want to change anything that’s already there.

Oh my gosh, it works! Thank you so much! I think I have been sitting here for two hours making the code more complicated than it needs to be. Once I got off track there was no going back, and I did not even remember what the original code looked like. I feel like I tried doing what you said about 30 minutes ago, and I still got errors. Maybe it was that I added that, but I also had stuff I was not supposed to add along with the correct addition.

1 Like

I’m glad you figured it out! Nice work!