Survey Form - Build a Survey Form

Tell us what’s happening:
so i cant understand why its telling me that neither one of my radio button groups have 2 buttons in them, i have 2 sections with 3 buttons each

   **Your code so far**
/* file: index.html */
<!DOCTYPE html>
 <link rel="stylesheet" href="styles.css">

<h1 id="title">Consumer Weed Survey</h1>
  <p id="description">A short questionare about your weed preferances</p>
<form id="survey-form">   
<fieldset id="survey-form">
 <label  for="name" id="name-label">Full Name<input placeholder="Name" id="name" required type="text"/></label>
 <label for="email" id="email-label">Email<input placeholder="Email" id="email" required type="email" /></label>
 <label for="number" id="number-label">Years of Experiance<input placeholder="420" id="number" required type="number" min="1" max="50" /></label>
 <label for="strain" name="strain">Favorite Strain<input placeholder="Strain" id="strain" type="text[a-z0-9]" /></label>
 <label for="male" name="male" value="male">Male<input value="male" type="radio" id="male" name="male" /></label><label value="female" for="female" name="female">Female<input value="female" type="radio" id="female" name="female" /></label>
 <label value="no" for="no" name="no">Rather not say<input value="no" type="radio" id="no" name="no" /></label>
<fieldset id="survey-form">
   <p>What is your favorite type of weed?</p>

    <label for="sativa" name="sativa">Sativa<input type="radio" id="sativa" name="sativa" value="sativa" /></label>
    <label for="indica" name="indica">Indica<input type="radio" id="indica" name="indica" value="indica" /></label>
    <label for='hybrid' name='hybrid'>Hybrid<input type="radio" id='Hybrid' name='hybrid' value="hybrid" /></label>
<fieldset id="survey-form">
 <h2>What is your perfered method of use?<h2> 
<select id="dropdown">
 <option value="1">Bong/pipe</option>
 <option value="2">Joint/blunt</option>
 <option value="3">Dabbing rig</option>
 <option value="4">Vape</option>
 <option value="5">Edibles</option>
<h2> What type of effects do you like when you get high?</h2>
<p id="checkall" name="checkall">Check all that apply</p>
<label for="headhigh" name="headhigh">Head High<input value=-"headhigh"= type="checkbox" id="headhigh" name="headhigh" /></label>
  <label for="bodyhigh" name="bodyhigh">Body High<input value="bodyhigh" type="checkbox" id="bodyhigh" name="bodyhigh" /></label>
  <label for="energetic" name="energetic">Energetic<input value="energetic" type="checkbox" id="energetic" name="energetic" /></label>
  <labe for="relaxed" name="relaxed">Relaxed<input value="relaxed" type="checkbox" id="relaxed" name="relaxed" /></label>
  <label for="glued" name="glued">Glued to the couch<input value="glued" type="checkbox" id="glued" name="glued" /></label>
  <label for="focused" name="focused">Focused<input value="focused" type="checkbox" id="focused" name="focused" /></label>
  <p>Tell us about you best weed experiance...</p>
  <button type="submit" id="submit">Submit</button>

/* file: styles.css */
fieldset, h1, p {margin: 0 auto;
     text-align: center;
     padding: 5px;
     max-width: 500px;
     min-width: 300px;
     font-family: monospace;

p {font-weight: bold;}

label {display: block;
      padding: 5px;
      text-align: center;}
   **Your browser information:**

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

Challenge: Survey Form - Build a Survey Form

Link to the challenge:

Hello there.

Please Tell us what’s happening in your own words.

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.

You need to label your attributes properly. You are missing this user story Inside the form element, you can select an option from a group of at least two radio buttons that are grouped using the name attribute

Hey! In a radio button group, a user is only able to select one single button among all of the members of the group but in your code, i can select all of the radio buttons at the same time which implies they are not a radio group which is why your tests are failing.

Screenshot from 2022-09-15 03-57-59

The expected behavior is that either i should be able to select Sativa or some value which is what i’ve done here.


The key to accomplishing that is to just use the same name attribute for both radio buttons. for example, try running this in your browser.

I love:
<input type="radio" name="pet" value="dogs"  /> dogs
<input type="radio" name="pet" value="cats"  /> cats

Hope this helps! :smile:

ahhhhh, thanks! obviously im new to this! lol

1 Like

thanks! that helped tremendously!

1 Like

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