Survey Form - Build a Survey Form

lost, it says i should have a label element with with an id of name-label

Your code so far

<!-- file: index.html -->
`` <h1 id="title">freeCodeCamp survey form<h1>
  <p id="description">Survey Form
    <form id="survey-form"><input name="Enter your name here"><input email="Enter your email here"><input type="email" id="email"><input type="number" id="number"><input type="name" id="name"><select id="dropdown"></p>
    <label for="name-label"><input id="name" type="text"  placeholder="First-Name" >
   
    </label>
    </form> ``
/* file: styles.css */
<link rel="stylesheet" href="styles.css">

Your browser information:

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

Challenge: Survey Form - Build a Survey Form

Link to the challenge:

Did you have questions on that step? You should have gone through the lessons on how to make an id. Right now you have no label with that id name. You have a for attribute with that name, but thats not the same thing as an id

yes i know . i was just trying something because when i had the id set to name-label i kept saying that it wasnt right

my bad bro im trying to copy it and show you how i changed it but im doint something wrong

If you are trying to put the code in, make sure to use the format button. It looks like </> click that, and paste the code between the two lines it gives you

Something I noticed in this line. I dont see the closing tag for this element here. It looks like you have it on the next line after inputs, but it needs to right your text here

cool i fixed that but i still cant copy and past it. when i try it just shows a preview of the actual web page but not the code if you get what i mean

You tried doing what the gif shows?

    <p id="description">Survey Form</p>
    <form id="survey-form">
      <input name="Enter your name here"><input email="Enter your email here"><input type="email" id="email"><input type="number" id="number"><input type="name" id="name"><select id="dropdown">
    <label id="name"><input id="name" type="text"  placeholder="First-Name" >
   
    </label>
    </form>```
1 Like

got it i was putting 2 `` instead of 3

So I see your label id is name, but as for what the challenge is looking for is

id="name-label"

    <p id="description">Survey Form</p>
    <form id="survey-form">
      <input name="Enter your name here"><input email="Enter your email here"><input type="email" id="email"><input type="number" id="number"><input type="name" id="name"><select id="dropdown">
    <label id="name-label"><input id="name" type="text"  placeholder="First-Name" >
   
    </label>
    </form>```

it still says its wrong like this

Is this your entire html? If not can you post all of it

yes thats all of it. i deleted all the other coding and started over so i can eliminate the steps one by one.

If you take your input out of your label, and put your label first then put your input it will work.

<label id="id name"> label text </label>
<input type="text">

This way it will work, I just tested to make sure.

Also I noticed this

<select id="dropdown">

You have a select element, but right after your select you have the label. This could be one of the things causing issues as well. I suggest looking up the select element again and seeing what goes in between the select. It is not a label, and a select needs a closing tag as well

ok im about to test it out

it was the select closing tag. thanks bro , for some reason i thought it acted as a self closing or something

1 Like

Cool, if you got it working then I will remove my spoiler. Keep it going

cool thanks again i really appreciate it