JavaScript contact form
POST a JSON body to the Formclick endpoint from fetch, Axios or any HTTP client. The response comes back as JSON, so you can show your own success message without leaving the page.
Set it up in 3 steps
- 1
Get your access key
Create a free Formclick account and copy the access key for your form from the dashboard. Submissions sent with that key are delivered to your inbox.
- 2
Send the request
Build an object with your access_key plus the fields you collect, then POST it as JSON. Set the Accept header to application/json to get a JSON reply.
- 3
Handle the response
Check success on the response and show data.message to the user, or your own confirmation UI.
The code
Replace YOUR_ACCESS_KEY_HERE with the key from your dashboard.
Tips
- You can also send new FormData(form) as the body if you would rather not build JSON by hand.
- Disable the submit button while the request is in flight to avoid double submissions.
- Every key you send other than access_key shows up as a field in your notification email.
JavaScript contact form FAQ
What does the response look like?
A successful request returns a JSON object with a success flag and a message, for example { success: true, message: "Email sent successfully." }.
Can I use Axios or jQuery instead of fetch?
Yes. Any HTTP client that can send a POST request works the same way.
Is it safe to ship my access key in client code?
Yes. The access key only allows submissions to be sent to your account. It cannot read your data, open your dashboard or change your settings, and you can restrict it to specific domains.
Do I need my own server or backend?
No. Formclick receives the submission, filters spam, stores it in your dashboard and emails it to you. Your app only makes one POST request.
How much does it cost?
Core features are free forever. Paid plans add higher submission limits and extras like file uploads. See the pricing page for details.
Other stacks
Your JavaScript form, live in minutes
Free forever on core features. No credit card required.
Create your form