Home
Support Forums

Netlify form submission does not work

Hi,
I just clone a starter repo https://github.com/cassidoo/next-netlify-starter.git.and uploaded to my netlify account,i updated the home page by addinf a netlify form like below.

Your Name:

Your Email:

Your Role:

Message:

Send

the final site is https://vigilant-turing-c54498.netlify.app/. the form is added in the the project. but i did not get any form submission.please help me.
1 Like

Did you check the Forms page in the Settings for the site in Netlify?

Another spot to check is in the Settings under Build & deploy -> Post processing, to ensure you have the Form detection enabled.

The Netlify documentation here (Forms setup | Netlify Docs) states:

When Netlify bots parse the static HTML for a form you’ve added, they automatically strip the data-netlify="true" or netlify attribute from the <form> tag and inject a hidden input named form-name .

When looking at your URL I still see the data-netlify="true" data attribute on the form, which would lead me to believe the bots haven’t parsed it… but I also see a hidden input named form-name.

Hi @midhundasap007,

Please don’t open duplicate threads: Netlify form not working when using next-on-netlify

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.