Build a Survey Form - failing 2 tests; don't know why

Can someone take a look at my code:

I am still failing 2 of the tests:

  • User Story #4: Inside the form element, I am required to enter my name in a field with id=“name”.
  • User Story #16: Inside the form element, I am presented with a button with id=“submit” to submit all my inputs.

But my code has both those pieces of code:

<p>  
  <label for="name" id = "name-label">Name:</label>
  <input type="text" id = "name" name="firstname" placeholder = "Enter first and last name.">
    
  </p>

and

<button type = "submit" id = "submit" form = "survey-form" value = "Submit">Submit</button>

Your browser information:

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

Link to the challenge:

I have just looked at your code, I think there are two problems there:

  1. button submit should be the last item in you form object. it should be inside the <form></form> tags.

2 Try <input type="text" id = "name" name="name" placeholder = "Enter first and last name." required >.

1 Like

I am a bit behind you and working on User Story #4.

I entered the following code and it does not pass the test:

Name:

You can see all my code at:

But I found someone else’s code that does pass the test and I do not know why:

You can see this other person’s code passing all the tests at:
https://amitkumarsarangi.github.io/Build-a-Survey-Form/

Hi, alfredhorg , try change
<input type="text" id="name" required placeholder="is not as good as mine."><BR> to
<input type="text" id="name" name='name' required placeholder="is not as good as mine."><BR>
hope it helps

Hi @alfredhorg,
To get the benefit of HTML5 validation you need to specify type='email' on that input field.

<input type="email" id="email" name="email" required placeholder="Enter email here.">
1 Like