An Alpine.js contact form in one x-data component
If your page already loads Alpine from a script tag, you're most of the way there. x-data holds the fields and a loading flag, fetch sends them to Formbold, and each entry lands in your inbox. The Free plan includes 250 submissions a month.
The x-data component
One x-data component, x-model on each field and a submit method that calls fetch. Paste it into any page that already loads Alpine 3, then replace FORM_ID.
How do I wire Alpine.js to Formbold?
Three steps, and no build step if you load Alpine from a CDN.
Create the form
Click Create New Form in the dashboard. Call it something like Alpine contact so it's easy to spot later.
Drop in your endpoint
The fetch call inside contactForm() needs your https://formbold.com/s/FORM_ID address. You will find it on the Form Setup tab.
Send a test
Submit the form and open Submissions. The keys in formData become the field labels you see there.
What does Formbold add to an Alpine form?
Alpine stays in charge of the UI. Storage, email, spam checks and integrations happen on Formbold's side.
Static hosting is fine
There's no endpoint of your own to deploy or patch, so Netlify, GitHub Pages or a plain storage bucket all work.
Spam settings for a fetch form
Turn on Basic Spam Filter. Alpine submits with fetch, so Custom reCAPTCHA is the captcha option that works here.
File uploads
From Starter. Switch the body to FormData for files, since x-model values sent as JSON can't carry them.
Send it on to Slack or Notion
On Starter and up, connect Slack, Notion, Google Sheets, Telegram or Discord from the Integrations tab, or use a webhook.
What else comes up with Alpine.js?
A few answers that save a round of debugging.
Still have a question?
The docs cover setup, framework guides, integrations and spam protection, step by step.