Build a survey form: first test

All your radio buttons should have a value attribute and value.
:point_up_2: this is one of the landmarks to achieve in the first project.
the problem is with the radio

and this is my code

<!DOCTYPE html>
<html lang="en">
<head>
  <meta charset="utf-8">
  <link rel="stylesheet" href="styles.css">
  <title>survey-form.freecodecamp.rocks</title>
  </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">
  <fieldset>
      <label for="name" id="name-label">Name <input type="text" id="name" placeholder="Enter your name"required ></label>
      <label for="email" id="email-label">Email <input type="email" id="email" placeholder="Enter your email" required></label>
      <label for="number" id="number-label">Age(optional) <input type="number" min="10" max="99" id="number" placeholder="Age"></label>
      <label>Which option best describes your current role?
        <select id="dropdown">
          <option value="0" readonly>Select current role</option>
          <option value="1">Student</option>
          <option value="2">Full Time Job</option>
          <option value="3">Full Time Learner</option>
          <option value="4">Prefer not to say</option>
          <option value="5">other</option>
        </select>
      </label>
</fieldset>


  <fieldset>
    <label>Would you recommend freeCodeCamp to a friend?</label>
    <label for="d_recommend"><input type="radio" value="" name="recommend" id="d_recommend"> Definitly </label>
    <label for="m_recommend"><input type="radio" value="1" name="recommend" id="m_recommend"> Maybe</label>
    <label for="n_recommend"><input type="radio" value="2" name="recommend" id="n_recommend"> Not sure </label>



  </fieldset>
  <fieldset></fieldset>
  <fieldset></fieldset>
  <fieldset></fieldset>
  <fieldset></fieldset>





</form>









</body>
</html>

i cant seem to figure out what i am doing wrong here.

Maybe you missed a value for this radio button

2 Likes

yeah that did the trick.
Bbut in the previous lesson, if i am not wrong, value=“” was used in representing the 0. was i wrong (obviously) or can it be done that way sometimes

1 Like

You can set value="", it’s the same as leaving the input text field empty then submit the form.
When the form is submitted, an empty string will be sent to the server.

I guess in this case, then the grader tool said “all the radio buttons should have a value”, it meant “value should not be empty”.

1 Like