Topic "create a radio button"

Tell us what’s happening:

Your code so far


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

 <a href="#"><img src="https://bit.ly/fcc-relaxing-cat" alt="A cute orange cat lying on its back."></a>

 <p>Things cats love:</p>
 <ul>
   <li>cat nip</li>
   <li>laser pointers</li>
   <li>lasagna</li>
 </ul>
 <p>Top 3 things cats hate:</p>
 <ol>
   <li>flea treatment</li>
   <li>thunder</li>
   <li>other cats</li>
 </ol>
<label>
   <form action="submit-cat-photo">

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

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

  <input type="text" placeholder="cat photo URL" required>
   <button type="submit">Submit</button>
 </form>
 </label>
</main>

Your browser information:

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

Challenge: Create a Set of Radio Buttons

Link to the challenge:

Hello there.

Do you have a question?

If so, please edit your post to include it in the Tell us what’s happening section.

The more information you give us, the more likely we are to be able to help.

hello All, can someone tell me the issue please. I am doing the radio button test and pasted all but last. says the radio button elements should be added within the form tag.
thank you Michael

I believe that you are confusing the test suite because you nested the buttons inside of labels incorrectly. Here is the example from the written challenge description:

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

remove <label> for <form> and </label> after </form> and it works!

@pkusaha Instead of posting solutions, try to help people instead by guiding them. Also, your code is not correct as you have an extra closing label tag (</label>).

1 Like

@lasjorg I guess they are already told to do what should be done, so I had just mentioned the solution to help them understand their mistakes!

@pkusaha We do not allow for posting solutions. It doesn’t help people learn. Also, if someone knows what to do, they do not need the solution.

Please just don’t post solutions, if you do post code, make it example code that can not just be copy-pasted.

1 Like

@lasjorg Ok got it and I did not know that

Hi , I went to the help and it didn’t show me the correct way, or I’m miss understanding. Thank you