Every radio button group should have at least 2 radio buttons

<!DOCTYPE html5>
<html>
  <head>
    <link rel="stylesheet" href="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">
    <label id="name-label">Name</label>
    <input id="name" type="text" placeholder="Enter your name" required/><br>
    <label id="email-label">Email</label>
    <input id="email" type="email" placeholder="Enter your email" required/><br>
    <label id="number-label">Age(optional)</label>
    <input id="number" type="number" placeholder="Age" min="18" max="100"/><br>
    <h4>Which option best describes your current role? </h4>
    <input type="text" placeholder="Select current role"/><br>
      <h4>Would you recommend freeCodeCamp to a friend? </h4>
    <input type="radio" name="Definitely" value="Definitely" /> Definitely
    <input type="radio" name="Maybe" value="Maybe"/> Maybe
       <input type="radio" name="Not sure" value="Not sure" /> Not sure
       <h4>What is your favourite feature of freeCodeCamp?</h4>
       <label for="dropdown">
         <select name="dropdown" id="dropdown">
           <option value="Select an option">Select an option</option>
           <option 
           <option value="Challenges">Challenges</option>
           <option value="Projects">Projects</option>
           <option value="Community">Community</option>
           <option value="Open Source">Open Source</option>
         </select>
       </label><br>
<h4>What would you like to see improved? (Check all that apply)</h4>
 <input type="checkbox" value="Front-end Projects"/> Front-end Projects<br>
 <input type="checkbox" value="Back-end Projects"/> Back-end Projects<br>
 <input type="checkbox" value="Data Visualization" /> Data Visualization<br>
 <input type="checkbox" value="Challenges"/> Challenges<br>
 <input type="checkbox" value="Open Source Community"/> Open Source Community<br>
 <input type="checkbox" value="Gitter help room"/> Gitter help rooms<br>
 <input type="checkbox" value="video"/> Videos<br>
 <input type="checkbox" value="City Meetups"/> City Meetups<br>
 <input type="checkbox" value="Wiki"/> Wiki<br>
 <input type="checkbox" value="Forum"/> Forum<br>
 <input type="checkbox" value="Additional Courses"/> Additional Courses<br>
 <h4>Any comments or suggestions?</h4>
 <textarea placeholder="Enter your comment here..."></textarea><br>
 <input type="submit" id="submit" name="submit" />
    </form>
  </body>
</html>

Hello there.

Do you have a question?

If so, please edit your post to include it.

Learning to describe problems is hard, but it is an important part of learning how to code.

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


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 (’).

Didn’t realize there was a duplicate of this, so I wrote out an answer here:
https://forum.freecodecamp.org/t/radio-button-group-should-have-at-least-2-radio-buttons/510942/2

3 Likes

How do I add at least radio buttons to the radio button group?

Your code so far

WARNING

The challenge seed code and/or your solution exceeded the maximum length we can port over from the challenge.

You will need to take an additional step here so the code you wrote presents in an easy to read format.

Please copy/paste all the editor code showing in the challenge from where you just linked.

 <!DOCTYPE html5>
<html>
  <head>
    <link rel="stylesheet" href="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">
    <label id="name-label">Name</label>
    <input id="name" type="text" placeholder="Enter your name" required/><br>
    <label id="email-label">Email</label>
    <input id="email" type="email" placeholder="Enter your email" required/><br>
    <label id="number-label">Age(optional)</label>
    <input id="number" type="number" placeholder="Age" min="18" max="100"/><br>
    <h4>Which option best describes your current role? </h4>
    <input type="text" placeholder="Select current role"/><br>
      <h4>Would you recommend freeCodeCamp to a friend? </h4>
    <input type="radio" name="Definitely" value="Definitely" /> Definitely
    <input type="radio" name="Maybe" value="Maybe"/> Maybe
       <input type="radio" name="Not sure" value="Not sure" /> Not sure
       <h4>What is your favourite feature of freeCodeCamp?</h4>
       <label for="dropdown">
         <select name="dropdown" id="dropdown">
           <option value="Select an option">Select an option</option>
           <option 
           <option value="Challenges">Challenges</option>
           <option value="Projects">Projects</option>
           <option value="Community">Community</option>
           <option value="Open Source">Open Source</option>
         </select>
       </label><br>
<h4>What would you like to see improved? (Check all that apply)</h4>
 <input type="checkbox" value="Front-end Projects"/> Front-end Projects<br>
 <input type="checkbox" value="Back-end Projects"/> Back-end Projects<br>
 <input type="checkbox" value="Data Visualization" /> Data Visualization<br>
 <input type="checkbox" value="Challenges"/> Challenges<br>
 <input type="checkbox" value="Open Source Community"/> Open Source Community<br>
 <input type="checkbox" value="Gitter help room"/> Gitter help rooms<br>
 <input type="checkbox" value="video"/> Videos<br>
 <input type="checkbox" value="City Meetups"/> City Meetups<br>
 <input type="checkbox" value="Wiki"/> Wiki<br>
 <input type="checkbox" value="Forum"/> Forum<br>
 <input type="checkbox" value="Additional Courses"/> Additional Courses<br>
 <h4>Any comments or suggestions?</h4>
 <textarea placeholder="Enter your comment here..."></textarea><br>
 <input type="submit" id="submit" name="submit" />
    </form>
  </body>
</html>

Your browser information:

User Agent is: Mozilla/5.0 (Macintosh; Intel Mac OS X 10_15_7) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/101.0.4951.64 Safari/537.36

Challenge: Build a Survey Form

Link to the challenge:

Remember that a “radio group” consists of radio inputs that share the same name attribute:

<input type="radio" name="group1">
<input type="radio" name="group1">

<input type="radio" name="group2">
<input type="radio" name="group2">

The above would create two separate groups of radio inputs.

3 Likes

It worked. I appreciate your help. Thanks.

1 Like

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