Home
Support Forums

Netlify form not working when using next-on-netlify

sir,
netlify form is not working when i using next-on-netlify version 3.0.1 for geting the help of isr feature of nextjs.it is worked when using fully static pages,like next export commend at that time i am not using next-on-netlify.help me please.

Hi @midhundasap007,

You’d have to create a static version of the HTML form and publish it somewhere in your website. The markup of that form should be exactly the same as the one you’d have in your actual website.

Netlify will detect this hidden form and thus, it would work.

I did not understand,sir.can i get you from more clarity?

Create a file form.html, save it in your public directory (or static depending on What Nextjs uses). That file should contain the exact code of the final compiled version of your form in Nextjs.

Actually there is no static files in nexjs.the static files are created on build phase ie next build, we can not create html files on our choice.we actueally create a page template,in that template we can add html forms like netlify form as in the nelify form documentation.This form is worked when using next build followed by next export comand.but in isr using next-on-netlify we run next build. the form is not working.please help me.

There are:

You need to put your form.html file there. It won’t be processed by Nextjs, which is exactly what we want.

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.

<form name="contact" method="POST" data-netlify="true">

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 submission.please help me.

Could you share your repo?