404 Page Not Found error upon form submission

I recently stood up a simple form on my next.js site. However, I get a 404 error every time I try to submit it.

My form looks like this

<form
  action="#"
  method="POST"
  name="register_company"
  data-netlify="true"
>
...
</form>

You can try it for yourself here. (Feel free to enter dummy data.)

How can I fix this?

Hi @ben519 welcome back! :smiling_face_with_three_hearts:

I put in some test information and I am also getting this error. Did you check out this forms debugging guide? [Support Guide] Form problems, form debugging, 404 when submitting

This might help you get unstuck.

Thanks, I was able to solve this. Because I’m was using Next.js, I needed to add a hidden input to my form like

<input type="hidden" name="form-name" value="register_company" />

This is described in the docs here.

These two articles were also helpful

Note Contrary to the docs and some articles, I did not need to create a .html file with a shell of my form. Also note that I didn’t notice my test submissions until I selected “Spam Submissions” in the Netlify forms dashboard.

1 Like

Ahh I see! Well thank you for letting us know also that tip about the “Spam submissions” I wouldn’t have thought to mention that. I appreciate the feedback. :smiling_face_with_three_hearts: