Survey Form - Build a Survey Form

Can’t understand what’s wrong with my botton.
It keeps telling me

  • You should have an input or button element with an id of submit.

  • Failed:Your #submit should have a type of submit.

Your code so far

<!-- file: index.html -->
<!DOCTYPE html>
<html lang="en">
  <head>
    <meta charset="utf-8" />
   <link rel="stylesheet" href="styles.css" />
<title>freeCodeCamp Survey Form</title>
</head>
<body>
  <h1 id="title">freeCodeCamp Survey Form</h1>
  <p id="description">Thank you for taking the time to help us to improve the platform</p>
  <form id="survey-form">
   <div class='input-element'>
     <label id='name-label'>Name<input required type='text' id='name' placeholder='Enter your name'/></label>
     </div>
  <div class='input-element'>
     <label id='email-label'>
       Email
       <input required type='email' id='email'placeholder='Enter your Email'/>
       </label>
     </div>
  <div class='input-element'>
     <label id='number-label'>
       Age
       <input required type='number' id='number' min='13' max='120' placeholder='Age'/>
       </label> 
     </div>   
  <div>
    <label for='dropdown'>Which option best describes your current role? <select id='dropdown'>
      <option value="">(select one)</option>
      <option value='1'>Student</option>
      <option value='2'>Full Time Job</option>
      </select></label>
      </div>
<div>
      <label>Would you recommend freeCodeCamp to a friend?
        </label>
        </div>
        <div>
          <label>Definitely<input type='radio' name="account-type" value='1'>
          </label>
          </div>
          <div>
            <label>Maybe
   <input type='radio' value='2' name="account-type"/></label>
   </div>
<div>
  <label>What would you like to see improved?</label>
  </div>
 <label>Videos <input required type='checkbox' value='1'>
</input>
</label>
</div>
  <div>
    <label> Forum <input required type='checkbox' value='2'></input>
  </label>
  </div>

 <div>  <label>Any comments or suggestions?<textarea id='submit' placeholder='Enter your comment here...' rows='4' cols='40'></textarea></label>
 </div>
   <input id='submit' type="submit" value="Submit"/>
    </form>
  </body>
 
/* file: styles.css */
body{
  text-align: center;
  background-color: lightblue 
}
form{
  text-align: left;
  border: 2px black solid;
  padding: 10px;
  border-radius: 10px;
  max-width: 500px
}

Your browser information:

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

Challenge: Survey Form - Build a Survey Form

Link to the challenge:

Id’s need to be unique. You can’t have both an input and a textarea with the same id.

1 Like

I didnt know that. Thanks a lot

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