The optimal solution for teams that want absolute control of their forms data.
Initiate the collection of form submissions from your Next.js form using formzillion.
Simply create your form in formzillion and insert your form-id into your form.
This guide will demonstrate the quick process of adding a contact form to your Next.js project and connecting it to Formzillion for submission handling.
How to create a Next.js Contact Form
Sign in to your Formzillion account and create a new form with name Next.js Contact Form or a similar identifier. Formzillion will assign a unique form ID specifically for identifying your Next.js form.
To initiate the project setup, let’s follow the instructions provided in the Next.jsGetting Started documentation. Open your terminal and execute the following command to create a new site:
Copy
On installation, you'll see the following prompts:
Copy
After the successful installation, a terminal message will appear containing instructions on how to access and run your site locally. Navigate to the newly created directory for your website:
Copy
Run the development server
Copy
You can now access the site in your browser by visiting https://localhost:3000. Below observe the sample site displayed on the screen:
Great job! You have successfully created a new Next.js site. Now, let's proceed to learn how to add a contact form into your project.
Copy
To incorporate a contact form into your Next.js site, you can either add it to the existing app/pages.tsx file or create a new page called app/contact/page.tsx. Then, simply insert the given code block into the chosen file:
To successfully submit your form to Formzillion, ensure that you include the 'FORM_ID' in the provided form code. This 'FORM_ID' should correspond to the ID assigned to your specific Formzillion form.
And there you have it! Once you fill out and submit the form, you will be able to view the default submission thank you page.
Congratulations! Your Next.js site now has the contact form powered by Formzillion!