Project user story: 12. When I click the #submit element, the email is submitted to a static page

> ## 12. When I click the #submit element, the email is submitted to a static page (use this mock URL: https://www.freecodecamp.com/email-submit) that confirms the email address was entered (and that it posted successfully).
> The #email input should have a name attribute : expected false to equal true
> AssertionError: The #email input should have a name attribute : expected false to equal true

I am not sure what is going on here and how i can fix this?
I put the action property onto the form and provided a name property to the input. What am i missing?

<html>
  <header id="header">
    <nav id="nav-bar">
      <img id="header-img" src="mcdonalds.png" />
      <div class="nav-right">
        <ul class="list">
          <li>
            <a id="nav-link" class="nav-link" href="#video-container"
              >Information</a
            >
          </li>
          <li>
            <a id="nav-link" class="nav-link" href="#email-container"
              >Some details</a
            >
          </li>
          <li>
            <a id="nav-link" class="nav-link" href="#pricing">Selection</a>
          </li>
        </ul>
      </div>
    </nav>
  </header>
  <section class="container">
    <div class="video-container" id="video-container">
      <iframe
        id="video"
        width="420"
        height="315"
        src="https://www.youtube.com/embed/tgbNymZ7vqY"
      >
      </iframe>
    </div>
    <div class="email-container" id="email-container">
      <h3>Learn more about us</h3>
      <form
        id="form"
        action="https://www.freecodecamp.com/email-submit"
        method="post"
      >
        <input id="email" placeholder="Enter email here" type="email" />
        <button type="submit" href="https://www.freecodecamp.com/email-submit">
          Sign up
        </button>
        <input type="submit" id="submit" value="submit" type="email" name="email" required />
      </form>
    </div>
    <section id="pricing">
      <div class="product">
        <div class="level">Didi</div>
        <h2>Basic</h2>
        <ol class="ordered">
          <li>info 1 fwrfgwrg</li>
          <li>info 2wf wf wf w</li>
          <li>info 3wef wef wef</li>
        </ol>
        <button>submit</button>
      </div>
      <div class="product">
        <div class="level">Uber</div>
        <h2>Select</h2>
        <ol>
          <li>info 1 wefwef</li>
          <li>info 2</li>
          <li>info 3 wefwef</li>
        </ol>
        <button>submit</button>
      </div>
      <div class="product">
        <div class="level">Tesla</div>
        <h2>Express</h2>
        <ol>
          <li>info 1 wef wef</li>
          <li>info 2 wfe</li>
          <li>info 3 wfwef e</li>
        </ol>
        <button>submit</button>
      </div>
    </section>
  </section>
</html>

Thanks :slight_smile:

Yaz

You have two submit buttons. You don’t need the one with a href since you’ve already set the post location in <form>

For #12, look where you’ve put your email name attribute and what the prompt is asking for
AssertionError: The #email input should have a name attribute

1 Like