Forms not submitting after adding recaptcha

I have two sites that had functioning forms on them but which were not effectively filtering spam. I added the data-netlify-recaptcha=‘true’ attribute to the html form element and since then I have not been able to get a form submission to register successfully. The form continues to show on the forms area of the Netlify dashboard. Can anyone help me identify the issue? Also, on submit the page simply refreshes with no success or error message.
Site url:
2nd site url:

Code for form (using Styled Components) below and React/JS/Styled Components code shown in screenshot.

<form method="POST" name="steady-hand-contact-form" data-netlify-recaptcha="true" class="Contact-styles__ContactForm-cl50ab-5 kieOPk"><div class="Contact-styles__LeftHalfInputs-cl50ab-7 cXKTgd"><input type="text" name="name" placeholder="Name" class="Contact-styles__LeftInput-cl50ab-9 LcJkg" style="background-image: url(&quot;data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABAAAAAQCAYAAAAf8/9hAAABHklEQVQ4EaVTO26DQBD1ohQWaS2lg9JybZ+AK7hNwx2oIoVf4UPQ0Lj1FdKktevIpel8AKNUkDcWMxpgSaIEaTVv3sx7uztiTdu2s/98DywOw3Dued4Who/M2aIx5lZV1aEsy0+qiwHELyi+Ytl0PQ69SxAxkWIA4RMRTdNsKE59juMcuZd6xIAFeZ6fGCdJ8kY4y7KAuTRNGd7jyEBXsdOPE3a0QGPsniOnnYMO67LgSQN9T41F2QGrQRRFCwyzoIF2qyBuKKbcOgPXdVeY9rMWgNsjf9ccYesJhk3f5dYT1HX9gR0LLQR30TnjkUEcx2uIuS4RnI+aj6sJR0AM8AaumPaM/rRehyWhXqbFAA9kh3/8/NvHxAYGAsZ/il8IalkCLBfNVAAAAABJRU5ErkJggg==&quot;); background-repeat: no-repeat; background-attachment: scroll; background-size: 16px 18px; background-position: 98% 50%; cursor: auto;"><input type="email" name="email" placeholder="Email address" class="Contact-styles__LeftInput-cl50ab-9 LcJkg"><input type="text" name="subject" placeholder="Subject" class="Contact-styles__LeftInput-cl50ab-9 LcJkg"><input type="hidden" name="form-name" value="steady-hand-contact-form"></div><div class="Contact-styles__RightHalfInputs-cl50ab-8 bJHKYq"><textarea name="message" type="text" placeholder="Message" class="Contact-styles__RightTextArea-cl50ab-10 hdesgY"></textarea></div><div></div><button type="submit" value="submit" class="Contact-styles__SubmitButton-cl50ab-6 ccxpky">SUBMIT</button></form>

Code for site:

Code for site:

Thank you!

hey there, first, some sanity checks -

This Support Guide is the first port of call to debug any forms issues.

If you are still having problems, please let us know!

Hi Perry, thank you for you response. I checked the support guide and am still having issues. The spam filtering seems to be inconsistent and there are several messages that never went through even though they were clearly not spam. Hoping someone can help me identify what is wrong.

A few more notes. I just sent a test submission on the site and ensured that the message wasn’t obviously spam/test content to ensure akismet wasn’t catching the submission. On submitting the form I never see the netlify thank you page, the site just refreshes. I also don’t see the submission in the netlify dashboard area in verified or spam submissions.

I just updated my code (for a bit which is shown in this screenshot. I noticed I had a ‘netlify=true’ as well as a ‘data-netlify=true’ attribute on the form, not sure if that was wrong but I removed it and just kept ‘data-netlify=true’.
I also changed the name of the netlify-honeypot attribute to ‘bot-field’ and made the hidden input match.
After trying the new form I got a 404 error. Not sure what else to try.
Thank you

hi NeversSync,

if you change the form in react/your SSG, you also have to change the form in the clear html version you are including somewhere so that our bots can process things correctly. Did you do that already?

I don’t understand. The site is built using React/Gatsby so the html version is being generated during build from the code in the screenshot (using Styled Components which is why the elements don’t have standard html syntax). Does that answer your question?

Hi! The issue is that on first load, we serve the html version of your form and are able to inject the recaptcha. However, Gatsby ‘rehydrates’ the site using Javascript which now makes it impossible for us to inject the recaptcha (since everything is loaded using JS). I recommend that you consider implementing a custom recaptcha instead (Spam filters | Netlify Docs). This method allows you to implement your recaptcha in any way you like as long as the steps on the docs are done.

Hope that helps.

Thank you for that info. I tried to implement that and got frustrated, so I decided to attempt to deploy the form on this site:
without the recaptcha at all and only using the honeypot field. When I submit the form I get a 404 and have no idea why. This seems like it should be pretty straightforward but at this point I can’t identify what is causing the issue if I know it isn’t related to the Recaptcha. Here is a screenshot of the form (also gatsby) for that site. Any more insights?
I appreciate your support.

Ok, I learned something new that I think could be helpful to add to the docs, and I still need a fix for the issue. The contact form was in a section of page that a user can navigate to by clicking on a link in the nav that scrolls them to the section using a CSS ID, in this case #booking, after navigating to that part of the page using the nav link the url is now:
When I submitted the form from this URL I get a 404 error, but when I submit the form with the ‘/#booking’ piece of the URL the submission goes through.
How can I get the form to submit regardless of whether the url has the anchor tag ID in it?
Thank you

Sorry for the multiple messages, but I just realized I was wrong, the form is still not submitting correctly even without the anchor tag ID in the url. I do get redirected to my new success page (I added 'action="/thanks" to the form element) but the form doesn’t successfully submit. I’m at a loss.

Hey there @NeversSync,

Doesn’t sound like we’re having a lot of fun!

Let’s take a step back. How are we implementing the form? I understand we’re using React. Maybe this blog post will help. It’s really thorough!