Astro contact form with zero client JavaScript
Astro ships no client JavaScript by default, and this form doesn't need any. Point it at your Formbold endpoint and each submission is stored and emailed to you, even on a fully static build.
What goes in my Astro component?
A plain HTML form in src/components/ContactForm.astro. Import it into a page with import ContactForm from "../components/ContactForm.astro", render <ContactForm />, and swap FORM_ID for your own.
Adding the form to an Astro site
Create the component, point it at Formbold, deploy. No adapter and no server output mode.
Create a form
Open the dashboard and click Create New Form. Free gives you 10 forms, so there is room for a separate test form.
Set the action
Copy https://formbold.com/s/FORM_ID from Form Setup into the action attribute. Keep method="POST".
Build and test
Run astro dev, submit once and check Submissions. The same form works after astro build on any static host.
Why does this work on a static Astro site?
Because the browser posts straight to Formbold. Your site never handles the request, so the default static output is fine.
No server endpoint
No API route in src/pages and no SSR adapter. Keep deploying to Netlify, Vercel, Cloudflare Pages or GitHub Pages as you do now.
Automatic reCAPTCHA
This is a native HTML post, so Automatic reCAPTCHA works without keys. Turn it on next to Basic Spam Filter.
File uploads
Add enctype="multipart/form-data" and a file input. Available on Starter and higher.
Send people to /thanks
On Starter and higher, set a Redirect URL and visitors land on a thank-you page you build in src/pages.
What else do Astro users ask?
Answers for static builds, MDX and inline success messages.
Still have a question?
The docs cover setup, framework guides, integrations and spam protection, step by step.