Survey Form Error Assisstance

Hello!

I completed my survey form project but for some reason, there is still an error related to the input id and the label id.

If I am not mistaken, the “for” attribute for label should match the id attribute for the input that corresponds with the label correct?

Your browser information:

User Agent is: Mozilla/5.0 (X11; Ubuntu; Linux x86_64; rv:89.0) Gecko/20100101 Firefox/89.0

Challenge: Build a Product Landing Page

Link to the challenge:

@ bbs2527, when a test fails click the red button to see which test(s) are failing and text to help you correct the issue.

  • Be sure and read more than just the first line of the failing message . The ability to read and comprehend error messages is a skill you’ll need to acquire as a developer. Ask questions on what you don’t understand.

The failing test message 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”.

Check your ids.

1 Like

Hi @bbs2527 ,

If I am not mistaken, the “for” attribute for label should match the id attribute for the input that corresponds with the label correct?

This is correct.

The test is failing coz it’s looking for an id attribute for the labels for Name, email and Age , like below:

<label id ="name-label"  for="name">Name</label>
<input type="text" placeholder="Name" id="name" required>

btw, your background image looks great! :+1:

1 Like

Suggestion

Errors


Feedback

  • background image looks great :ok_hand:.

happy coding⭐.

1 Like

I read it but I think I misconstrued what the error was mentioning. I thought it wanted the inputs to have id=“name-label”, id=“email-label”, and id=“number-label” which would have been strange considering it already requested specific ids and the for attribute to the corresponding labels wouldn’t have matched. I went ahead and added the id to the label elements and it seemed to be good error wise now :).

Thanks! That was the issue (for a second I thought it meant add another id to the inputs). Now everything passes :smiley:

Thanks for the error catches and the suggestion! I made sure to fix them :). Everything should be in working order now :).

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