Survey Form Unexpected Error

Hello guys! I am working on the survey form challenge of the responsive web design course. I’ve been trying to figure out what I am doing wrong for a long time. I’m sure it’s going to be something silly, but here it is - https://codepen.io/coder_ps/pen/KKWggwO - the 4th test won’t pass! I don’t know why. Could somebody please correct me?
Thanks!

@prajaktas, when a test fails I tell people to 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 says

Inside the form element, I am required to enter my name in a field with id="name". If I do not enter a name I will see an HTML5 validation error.
input field with id="name" should be a text field : expected undefined to equal 'text'
AssertionError: input field with id="name" should be a text field : expected undefined to equal 'text'

Looking at your code shows

<div>
  <label id="name" for="name">Name: </label>
  <input type="text" id="name" name="name" class="form-control" placeholder="Enter your name" required />
</div>

The error here is that you have two id's that are the same. Remember, an id must be unique within the document. The test is seeing the first id="name" which is not the input field that the test is looking for.

Hope that helps.

Thanks! That helped :pray:t2: :smiley:

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