Form action leading to 404

I’ve read the form documentation and troubleshooting posts. My form results are being submitted successfully, but the action afterwards is leading to a 404 (This site can’t be reached). I am using Netlify’s unmodified HTML form example. So, it should show their default thank-you page – it does not. If I try setting uo <form action="/thanks" …> or <form action="/thanks/" …> to my own /thanks or /thanks/ page, it still leads to a 404. I assure you the page exists when visiting the page directly – https://mysite.com/thanks/

Code being used:

<form name="contact" method="POST" data-netlify="true">
  <p>
    <label>Your Name: <input type="text" name="name" /></label>   
  </p>
  <p>
    <label>Your Email: <input type="email" name="email" /></label>
  </p>
  <p>
    <label>Your Role: <select name="role[]" multiple>
      <option value="leader">Leader</option>
      <option value="follower">Follower</option>
    </select></label>
  </p>
  <p>
    <label>Message: <textarea name="message"></textarea></label>
  </p>
  <p>
    <button type="submit">Send</button>
  </p>
</form>

Hiya, sorry you are having trouble getting your forms to work.

This Common Issue is the first port of call to debug any forms issues.

We also recommend trying to search the forums or look at topics tagged Netlify forms if you haven’t already - it’s likely your question was already asked by someone else!

If you are still having problems, please provide more information such as what you have already tried, and a link to your live form. :slight_smile:

It was a service worker thing. I had to exclude the page. It simply works now.

Reference: https://community.netlify.com/t/form-submission-working-but-action-path-is-not-working/9902

1 Like