imorente / gatsby-netlify-form-example

Example site integrating Netlify's form handing in Gatsby's starter template
MIT License
138 stars 32 forks source link

Netlify form native submission does not work #20

Open ghost opened 5 years ago

ghost commented 5 years ago

I noticed that I cannot seem to get native Netlify forms to work. I do not get a default response message either from the native form.

        <form
          name="Frontend Monday"
          method="post"
          class="HeroForm"
          data-netlify="true"
          data-netlify-honeypot="bot-field"
        >
          <input type="hidden" name="bot-field" />
          <input type="text" name="name" placeholder="Name" />
          <input type="email" name="email" placeholder="" />
          <button type="submit">Send</button>
        </form>

Any thoughts?

willlma commented 5 years ago

Would love a response on this. Have had the same issue and haven't found a solution for several days.

ghost commented 5 years ago

Hi @willlma,

Try creating a component for your form and changing the form to this:

<form
    name="HeroFormX"
    method="post"
    action="/success"
    data-netlify="true"
    data-netlify-honeypot="bot-field"
  >
    <input type="hidden" name="bot-field" />

    <div>
      <label htmlFor="name">Name</label>
      <input type="text" name="name" id="name" required />
    </div>
    <div>
      <label htmlFor="email">Email</label>
      <input type="text" name="email" id="email" required />
    </div>
    <div>
      <input type="submit" value="Sign up" />
    </div>
  </form>