How do I add radio buttons to radio button groups?

I am stuck on this survey form problem: “Every radio button group should have at least 2 radio buttons.” please someone clarify for me thanks in advance!:slightly_smiling_face:

We need to see your code. Did you give the same name value to the radio buttons so they are grouped?

MDN: Defining a radio group


When posting code you can use the “preformatted text” tool in the editor (</>) to add backticks around the code to get the proper code formatting.

ok sorry im new here. do i just add ther link? heres the link to my code: https://www.freecodecamp.org/learn/2022/responsive-web-design/build-a-survey-form-project/build-a-survey-form

<!DOCTYPE html>
<html>
  <head>
    <link ref="stylesheet" src="styles.css"/>
  </head>
  <body>
    <h1 id="title">freeCodeCamp Survey Form
    </h1>
    <p id="description">Thank you for taking the time to help us improve the platform</p>
    <form id="survey-form"> <input type="email" id="email" placeholder="Enter your email" required/>
    <input id="name" type="text" required placeholder="Enter Name"/>
  
       <input id="number" type="number" required min="18" max="120" placeholder="Age"/>
       <label id="name-label">Enter Name:</label>
         <label id="email-label">Enter Email:</label>
                <label id="number-label">Enter Age:</label>
      <select id="dropdown">
        <option></option>
        <option></option>
      </select>
      <input type="radio" value="submit" name="definitely"/>
 <input type="radio" value="yes" name="decision"/>
       <input type="radio" value="maybe" name="decision"/>
      
              <input type="radio" value="no" name="decision"/>
  
              <input type="checkbox" value="submit"/>
              <input type="checkbox" value="submit" />
              <textarea placeholder="Enter comments here..."></textarea>
              <button id="submit" type="submit">Submit</button>

    </form>

  </body>
</html>

1 Like

The message is telling you that for every radio button you have with a name there should be a total of at least two radio buttons with that same name. So name="definitely" has to be on two radio buttons. Or you can just remove that one radio button (not really sure what its purpose is anyway).

ok thank you so much! :blush:

1 Like

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