In the form it challenge, I cannot figure out why it is not showing correct. Number 10 says, " For the name, email, and number input fields inside the form I can see corresponding labels that describe the purpose of each field with the following ids: id=“name-label”, id=“email-label”, and id=“number-label”.
Now I have put the following in the form:
“input type=“text” placeholder=“Name” id=“name” id=“name-label” required”
and I still cannot get this one correct. Can someone tell me what I am missing?
It would help to see your codepen to know where the error is
How can I do that? Let me know and I will.
<title>My Form</title>
<h1 id="title">My Form</h1>
<p id="description">Description</p>
<form id="survey-form">
<label>Name</label>
<input type="text" placeholder="Name" id="name" id="name-label" required><br><br>
<label>Email:</lable>
<input type="email" placeholder="Email" id="email" id="email-label" required><br><br>
<label>Number</label>
<input type="number" placeholder="Number" id="number" id="number-label" min="1" max="5"><br><br>
<input type="dropdown" id="dropdown"><br><br>
<button type="submit" id="submit" value="submit">Submit</button>
</form>
title>My Form</title>
h1 id="title">My Form</h1>
p id="description">Description</p>
form id="survey-form">
label>Name</label>
input type="text" placeholder="Name" id="name" id="name-label" required><br><br>
label>Email:</lable>
input type="email" placeholder="Email" id="email" id="email-label" required><br><br>
label>Number</label>
input type="number" placeholder="Number" id="number" id="number-label" min="1" max="5"><br><br>
input type="dropdown" id="dropdown"><br><br>
button type="submit" id="submit" value="submit">Submit</button>
/form>
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 (’).
The problem is here
You can’t write multiple ids like that.
Elements should only have one id to them.
Actually, the id of name-label as well as email-label needs to go with the correct element of label. not input
Tell me about it. I tried to only put one, then I would get the other id requirement wrong.
When I put it back in it becomes correct again.
The label element needs the ids of name-label, etc.
The inputs, need the ids of name, email, etc.
Hope that clears it up.
So I should put it under the label element and not the input?
Let me try that and see if that will work. I have it up so give me a second to make the changes please.
Yes that did the trick. I placed the id element inside the label tag and it worked. Thanks for your help.
This topic was automatically closed 182 days after the last reply. New replies are no longer allowed.