Web Survey Form - Problem with Required Attribute

I am working my way through this project; I am following each User Story, and adding code to pass each test. I have run into a problem with User Story #5, which reads: " User Story #5: Inside the form element, I am required to enter an email in a field with id="email" ."
My question is that this is really a small variation from User Story #4, which is " User Story #4: Inside the form element, I am required to enter my name in a field with id="name" ."
If I was able to pass Test #4, why doesn’t it work for passing Test #5?
Here is my HTML:

<form id="survey-form">
  <form id="name">
<label>Name</label>
  <input type="text" id="name" name="name" required>
  </form>
  <form id="email">
  <label>Email</label> 
  <input  type="email" id="email" name="email" required>
</form>
</form>

Welcome, pmdenlinger.

Ideally, you should only have 1 form on your webpage. The name and email inputs should be just that…input elements.

Refresher lesson (this lesson and onwards):

Hope this helps

1 Like

Welcome to the forums @pmdenlinger.

It’s easier to help if you post a link to your code rather than a small snippet.

But just from what you’ve posted there’s a glaring error. There should only be one form element. Form elements inside of form elements are not allowed.
As a help, try searching for “html form elements”

Thank you very much; I will fix that.

Here is the link: https://codepen.io/pmdenlinger/pen/YzqMKMm

an id can’t be repeated in your page. use an id only once

@pmdenlinger Your code should only have one form element. The code you linked via Code Pen shows multiple. I would go back and review the lesson on form elements if you are still stuck.