Survey Form test error

Hi guys, I am trying to do this Survey Form test, but one code won’t pass at all no matter what I write it’s about label with an ID name-label. I type my code this way

<label id="name-label">Name</label>
<label id="email-label">Email</label>
<label id="number-label">Number</label>

I have three same elements, name-label, email-label and number label and none of them work. I constantly get the same message:

  1. You should have a label element with an id of name-label .
  2. Your #name-label should contain text that describes the input.

What’s strange…if I use an INPUT element on the first label element, the other two will be correct…like this

<label><input id="name-label">Name</input></label>
<label id="email-label">Email</label>
<label id="number-label">Number</label>

But if I apply INPUT element on all three, none of the will be correct. I have no idea what to do.

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

Oh haha…thank you so much! I was wondering what happened to it

I’m suspicious that you have some syntax error elsewhere in your code.

Hmm…Do you have any idea where it might be? I’ve passed all the other steps…But I might go back and rearrange a few things, I guess

It’s impossible for me to guess without seeing more code.

1 Like

This is everything I’ve done so far…I’ve even included an INPUT element around the first LABEL and now the other two show as correct, just the one with an INPUT element is not

It is really hard to read a picture of code. It is better to post your actual code.

How do I do that? I am super new at this :frowning:

Like this here

1 Like

Isn’t input a self closing element?

<link rel="stylesheet" href="styles.css">
<h1 id="title">Survey</h1>
<p id="description">Please tell us about yourself<p/>
<form id="survey-form">
  <select id="dropdown">
    <label><input id="name-label">Name</input></label>
    <label id="email-label">Email</label>
    <label id="number-label">Age</label>
    <option type="radio" name="eye-color">The color of your eyes</option>
    <option type="radio" name="hair-color">The color of your hair</option>
  <label>Name:<input id="name" required="" type="text" placeholder="Enter your name here"></input></label>
  <input type="email" id="email" required="" placeholder="Enter your email here"></input></label>
  <input type="number" id="number" min="13" max="120" placeholder="Enter your age here"></input>
    <label><input type="radio" name="blue-eyes" value="eyes">Blue</input></label>
    <label><input type="radio" name="blue-eyes" value="eyes">Green</input></label>
    <label><input type="radio" name="brown-eyes" value="eyes">Brown</input></label>
    <label><input type="radio" name="brown-eyes" value="eyes">Brown</input></label>
    <input type="checkbox" required="" value="Age">I am over the age of 13</input>
    <input type="checkbox" required="" value="Terms and conditions">I accept all Terms and Conditions</input>
    <textarea>Tell us more about yourself</textarea>
    <input type="submit" id="submit" value="Submit"</input>


Ok, I’m seeing syntax errors when I run your code through a validator:

1 Like

Oh woow! All of these ELEMENTARY things are missing in my code! I was blindly following the instructions which didn’t says to use DOCTYPE and other things…I should have done that alone, by myself, without being told to do it. Thank you so much. I’ll go ahead and insert these, and then maybe the label element will work as well

I think some of the bigger things like the <p/> bug and the </input> are likely to confuse the test suite.

1 Like

Thanks a lot for your help!!! Have a great day :slight_smile:

1 Like

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