danurbanowicz / eleventy-netlify-boilerplate

A template for building a blog with the Eleventy static site generator and Decap CMS
https://eleventy-netlify-boilerplate.netlify.app/
MIT License
528 stars 183 forks source link

Form submissions not working #63

Closed TylerMRoderick closed 3 years ago

TylerMRoderick commented 3 years ago

Describe the bug I deployed this project to Netlify, but the form submissions were not working for me. The "forms" tab in my Netlify dashboard also didn't show any active forms.

Solution On the <form> tag, I replaced netlify with data-netlify="true" and that fixed the problem. The Netlify forms documentation still seems to support the netlify attribute alone, so I'm not sure why this was an issue. Either way, I'm just leaving a note here in case anyone else runs into the same issue.

Thanks for the boilerplate 👍

danurbanowicz commented 3 years ago

Yeah this is weird; just tested with a fresh deploy of this repo and the resulting form is not working (it returns a 404 on submit), however I got the same error when using the alternative data-netlify="true" format also. So it might not be related to that.

In both cases, the form is recognised by Netlify during the build (the form shows in the build log) but the resulting form does not appear to be handling the submissions.

danurbanowicz commented 3 years ago

This seems to be an issue with Netlify's form detection not recognising the contact form on a newly created site.

Interestingly, disabling and immediately re-enabling form detection in: Build & Deploy > Post processing > Form detection caused the contact form to be recognised and to accept submissions.

danurbanowicz commented 3 years ago

I'm going to close this now as Netlify have been notified about the problem and we need to wait on them. I'll post any update here.

If anyone else is having problems with the contact form being recognised on new Netlify deployments, please reply to this or open a new issue.

danurbanowicz commented 3 years ago

Netlify support have confirmed of a problem at their end causing Netlify forms to not be recognised during builds, and to fail silently.

https://answers.netlify.com/t/netlify-forms-new-forms-not-being-recognised/32825/17?u=danurbanowicz

Removing the name attribute from the form submit button causes the form to be recognised. We're still not sure why this is.

danurbanowicz commented 3 years ago

This has been temporarily fixed by 7de2dcd