Netlify form submission does not work

Hi @midhundasap007,

Please don’t open duplicate threads: https://answers.netlify.com/t/netlify-form-not-working-when-using-next-on-netlify/46478

my repo url is https://gitlab.com/midhundasap/platformproperties-image-optimization.git

Hi @midhundasap007,

The repo appears to be private. I’m not able to access it.

could you give me your gitlab id(email id)?

My GitLab username is @hrishikeshk. Hopefully, that’s enough to share the repo?

Hi,
I added you to my repo.please check. the branch is build in the netlify is develop.

I’m trying your repo but it doesn’t work for me locally. I’m running npm i && npm run dev. I’m using Node v14.17.5 (npm v6.14.14).

I get this error:

Need to switch branch to develop.
step to follow.
git checkout develop
npm i
npm run dev for development .
npm run build , npm run start for production.
but for checking netlify form we need to check the site hosted in netlify ie https://vigilant-turing-c54498.netlify.app, not in local.also my local node version is 12.18.4 and npm is 7.16.0

build process detect the from.see the screenshot

please give me a solution.my project is stuck now.

Need to switch branch to develop.
step to follow.
git checkout develop
npm i
npm run dev for development .
npm run build , npm run start for production.
but for checking netlify form we need to check the site hosted in netlify ie https://vigilant-turing-c54498.netlify.app, not in local.also my local node version is 12.18.4 and npm is 7.16.0

So I checked various stuff and it appears that this might not work. The reasons are as follows:

The reason you’re not receiving submissions is because (point 2 of Submits fine, yet no submissions in UI:):

Next.js is using Netlify Functions to render your page which is why the submissions are lost. Furthermore, the problem is that, even when I tried adding the extra thanks.html static page in public folder, Next.js functions failed to render that page until I manually added the .html.

I tried this:

but that didn’t help.

I even tried plugin v3.9.2 that’s the current stable version and that didn’t help too.

So, this might not work, but we would get this confirmed with the developers soon.

2 Likes

Thanks for your replay.I expect the solution form the team as soon as possible.

Whilst they will definitely try their best to research further, please remind yourself that the folks at Netlify may have many issues to investigate before they reach this one… be patient :slightly_smiling_face:

Kyle.

1 Like

Hi there, @midhundasap007

I want to assure you we haven’t forgotten about this! We are speaking with our Nextjs experts and hope to have more insights soon.

Hi @midhundasap007,

Sorry for the delay, this was an overlook on my part and didn’t need any developer intervention after all - just thought about this randomly while I was doing something else.

So you just need to do 3 things:

  1. {/* <input type="hidden" name="form-name" value="contactForm" /> */} uncomment that line.
  2. Create a file (for example thanks.html) in your public folder. It could show the contents of your thank you page for example <h1>Thanks</h1>.
  3. Finally, add action="/thanks" attribute to the <form> tag.

That does the trick.

I updated with your code.i got thanks page.but does not get any form submission in netlify ui.
please check my gitlab repo.

I just submitted the form on the website you shared above and I can see that you’ve got a submission just fine.

Its working now.thanks a lot.I need to test it on my live site.

1 Like