Form working for spammer but not for me

I have a wordpress site with a form. I converted the WP site to static site, put it on GitHub, added the form code specified in the docs to index.html and tested.

When I test it the form doesn’t work:
(1) there is no “generically styled success message with a link back to the form page”
(2) the form submission is not visible on https://app.netlify.com/

That said, the form is visible on https://app.netlify.com/ - I see it’s name.
Also, while my test submissions failed, I can see a submission on the “Spam Submissions” list.

Any help would be appreciated!

Did you use the search before posting? >> YES, read this stuff…

Your Netlify instance name: dreamy-hamilton-293f93
Site: http://thomasjcoffey.com/
Code: GitHub - tjc4/thomasjcoffey
Form Code with Netlify Snippets Added: can be found on lines 856-902 of index.html

hi there, looking at your site, I see this:

<a href="#" target="_self" class="fl-button" role="button"> <span class="fl-button-text">Contact Tom</span> </a>

instead of an actual button. To the best of my knowledge we need an actual submission to be able to pick up the form submit.
can you replace that with <button type="submit">Contact Tom</button>

and see if your form submits?

Perry, thanks for the reply! I replaced the code per your suggestion.

However the form is still not working. Any other suggestions? Thanks again!

Hi, @tjc4, when submit the form I get a 303 response for the following request URL:

https://thomasjcoffey.com/POST

I believe this is because the “action” (not the “method”) for the form is POST:

		<form class="fl-contact-form" action="POST" name="netlify_contact_form" data-netlify="true" Content-Type="application/x-www-form-urlencoded" >

Would you please test changing that line to this (below) instead?

		<form class="fl-contact-form" method="POST" name="netlify_contact_form" data-netlify="true" Content-Type="application/x-www-form-urlencoded" >

If this doesn’t resolve the issue, please let us know.

Luke, thanks for the reply. I changed the code as you suggested but my form is still not working.

I do not get the “success message” when I click submit nor do I see my test messages in the “Verified submissions” list (though I continue to get new submissions in the “Spam submissions” list).

Any additional suggestions you could offer would be appreciated. Thanks again!

Perhaps you have two copies of the form in your deploy? The one I see on at your URL has this definition:

<form class='fl-contact-form' method='POST' name='netlify_contact_form' Content-Type='application/x-www-form-urlencoded'> (no action specified)

…but in your last depoy, we got one with a definition that still had an action=POST

Please set action=/thank-you explicitly in a new deploy to see if that helps?

Fool, thanks for the reply.

As far as I’m aware there is only one form in the deploy.

You state “in your last deploy, we got one with a definition that still had an action=POST”

I’m not sure why this would be. I deploy from GitHub and three days ago, per Luke’s suggestion, I pushed a change to GitHub that changed from action="POST" to method="POST". Below is a screenshot showing that change in GitHub and when I load thomasjcoffey.com I see method="POST" in the site code.

Regardless, I just tried adding action=/thank-you and deploying via GitHub.

I added it to the same line I’ve been editing. It now reads <form class="fl-contact-form" method="POST" action=/thank-you name="netlify_contact_form" data-netlify="true" Content-Type="application/x-www-form-urlencoded" >

Is that where I was supposed to place the action=/thank-you code? I still don’t get a success message and form submission data isn’t flowing to Netlify.

It doesn’t look like your action path exists. If you go here: https://thomasjcoffey.com/thank-you, you’ll get a 404. For that that work, you will need to make sure to include that page in your deploy.

Dennis, thanks for the reply.

I’m not trying to set up a custom success page. I only added the “thank you” code because Fool suggested it.

I’d fine with the “generically styled success message with a link back to the form page" described in the setup docs.

The problem is I’m not getting neither a form submission nor a generic success message.

If you could help with those issues it’d be most appreciated. Thanks again!

Hi Thomas, it looks like you are trying to use a custom recpatcha. However, I don’t see that you have the environment variables set up for the recaptcha to work. Could you follow the steps mentioned in the link and then re-deploy your site? Let me know if that helps.