Create a Set of Radio Buttons- buttons not in form tag?

Tell us what’s happening:

It keeps telling me my buttons are not inside the form tag, why?

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>
  
  <form action="/submit-cat-photo">

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

   <input type="text" placeholder="cat photo URL" 
    required>

   <button type="submit">Submit</button>

  </form>
</main>

Your browser information:

User Agent is: Mozilla/5.0 (X11; CrOS x86_64 9592.85.0) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/60.0.3112.112 Safari/537.36.

Link to the challenge:
https://learn.freecodecamp.org/responsive-web-design/basic-html-and-html5/create-a-set-of-radio-buttons

You are adding extra html elements here called <button> which is unnecessary. You are already creating radio button input boxes here with input type="radio"

Remove <button> elements and it should work.

1 Like

Oh my gosh, you’re totally right I feel like an idiot lmao I guess I was somehow trying to use the same format I did when I created the submit button and got confused. Thank you so much! This makes so much more sense now.