Form submissions not being picked up

I’ve been trying to integrate Netlify Forms into my site (https://test--fullbrook.netlify.app/) based on the Netlify Content Ops Starter.

Originally, the form was not picked up by Netlify, until I created a static HTML form to help the Netlify bot scrape the details. My understanding was that for Next.js (and other SSR frameworks), this was a required step in formalising the form. The next step would be to create the form in the JSX which MUST have matching fields and form-name parameters.

I have done this and I’ve read through what feels like every post on the forum and I still can’t get any form submissions picked up by Netlify.

My code repo is: https://github.com/Leoooob/fullbrook-window-cleaning/tree/test

My static form includes the form fields with correct names, my JSX includes the same fields as the static form, with the same names. The JSX form also includes a hidden input defining the form name and the onSubmit function encodes the form data and pings a known route via POST method.

I cannot work out why it isn’t working, if anyone can educate me, that would be great.

Thanks.

@Leoooob You need to perform the POST to a route that’s not being handled by Next.

Usually this would be the static HTML form file that you created.

At the moment you’re posting to / which is being caught by Next, and not reaching Netlify’s handling:

Netliy’s Next documentation is here:
https://docs.netlify.com/frameworks/next-js/overview/

It references this Next specific documentation:
https://opennext.js.org/netlify/forms

In your dynamic page or form component, handle the submission by serving a POST request to the static HTML file you’ve created above (using the example above: /__forms).

Thanks a lot Nathan, it looks like I never actually ran the code after testing this myself. A classic problem in the chair!