Integrate · Last updated May 16, 2026
JavaScript / Fetch integration
Prefer not to reload the whole page after submit? POST JSON (or FormData) with fetch. The endpoint is identical for React, Vue, SvelteKit, Astro, Bun, Workers, CLI tooling — browse the stacked guides starting with React; every page reiterates HTML forms when redirects matter instead of JSON responses.
AI assistant prompt
Wording targets vanilla fetch + JSON plus shared CORS notes—framework ergonomics live in their own docs. Expect async/await, error surfacing, and YOUR_FORM_ID.
Help me integrate SaveForm.io (https://www.saveform.io) using plain JavaScript fetch() in the browser or on a runtime (Node, Bun, edge workers — same HTTPS contract everywhere).
Please:
1. Ask me which fields belong in the JSON (or FormData) body — names match what SaveForm stores; include validation or UX checks I specify.
2. Implement async submission: POST https://saveform.io/api/submit/YOUR_FORM_ID with method POST, Content-Type application/json where appropriate, JSON.stringify payloads, parse response.json(), and surface network + non-OK errors.
3. Tell me explicitly to replace YOUR_FORM_ID with my real form ID from SaveForm → Dashboard → Forms (copy the form ID). Without my actual ID in the URL, submissions will not reach my workspace.
4. Call out localhost / browser CORS: SaveForm's submit endpoint is CORS-open; keep secrets out of frontend code.
5. Note that frameworks add ergonomics only — Vue, Svelte, Solid, Astro, Gatsby, and typed guides all link from the docs index with the identical endpoint contract.
6. Use this doc when helpful: https://www.saveform.io/docs/javascript-integration
SaveForm control fields (names starting with _): pass them as normal keys in the JSON or form body when useful:
• _honey — honeypot for spam filtering: https://www.saveform.io/docs/spam-protection
• _redirect and _redirect_mode — thank-you URL and whether to show SaveForm's success page first vs redirect immediately: https://www.saveform.io/docs/custom-redirects
• _emailTo — optional per-submit override for where the notification email is sent: https://www.saveform.io/docs/email-notifications
• Submitter auto-reply (acknowledgement email) is configured on the form in the dashboard with {{field}} placeholders, not ad-hoc payload fields: https://www.saveform.io/docs/auto-replyFetch example
Send a JSON body with fetch(). Runs in evergreen browsers plus Node 18+, Bun, Cloudflare Workers, etc.
JavaScriptsubmit-form.js
const formData = {
name: 'John Doe',
email: 'john@example.com',
message: 'Hello!',
};
fetch('https://saveform.io/api/submit/YOUR_FORM_ID', {
method: 'POST',
headers: { 'Content-Type': 'application/json' },
body: JSON.stringify(formData),
})
.then((response) => response.json())
.then((data) => console.log('Success:', data))
.catch((error) => console.error('Error:', error));Optional SaveForm control fields use normal payload keys:
_honey (spam honeypot), _redirect / _redirect_mode (redirect after submit), _emailTo (notification recipient). Submitter replies use dashboard auto-reply. Supported fields →