SvelteKit multi-step form
Build a multi-step form in SvelteKit with no server route. Collect fields across steps in a data object, then post once to Formpaste at the end. Copy the wizard component and add your access key.
How to build it
- Create a form in your Formpaste dashboard and copy its access key.
- Copy the multi-step component below into a SvelteKit page or component.
- Replace YOUR_ACCESS_KEY_HERE with your access key, then deploy.
Prompt for your AI coding agent
Add a Formpaste multi-step form to my SvelteKit app. Use a Svelte component with a <script> block that collects name, email and message across several steps in a data object with Next and Back buttons, then POSTs once at the end as application/x-www-form-urlencoded (URLSearchParams) to https://api.formpaste.com/submit with a hidden access_key. Do not post on every step and do not add a server route.Or connect the Formpaste MCP server to Claude Code, Codex, Cursor, Claude Desktop, VS Code, or any mcp-remote client. See the setup guide.
SvelteKit gotchas
SvelteKit gives you server routes and form actions, but for a form you do not need them. A Formpaste form is a Svelte component that posts straight to Formpaste, so there is no +page.server.ts action and no +server.ts route to write. It works with SSR or a static adapter-static build.
No server route or form action needed
You do not need a +page.server.ts action or a +server.ts endpoint. The component posts directly to the Formpaste endpoint, which keeps the app deployable anywhere, including a fully static adapter-static build.
It is a Svelte component
SvelteKit is Svelte, so the form is a single-file component with bind:value and an on:submit|preventDefault handler. Use the Svelte code from the toggle above - it works the same inside SvelteKit.
Progressive enhancement is optional
SvelteKit form actions with use:enhance are great for your own endpoints, but here the endpoint is Formpaste. A plain on:submit|preventDefault fetch is simpler and needs no server code of yours.
SSR or static, same form
Because the form posts to an external endpoint, it works whether you deploy with SSR or as a static site. No server code of yours runs at submit time.
What to get right
One form, several screens
A multi-step form is a single submission split across steps in the UI. Collect all the fields in client state, then post once at the end.
Route per step is optional
You can give each step its own URL for back-button support, or keep it all on one page with local state. Both post the same final payload.
Post the whole payload once
Do not post on every step. Gather the fields as the user advances and send one request when they finish.
How it works
Three simple steps for form submissions to land in your email inbox.
Create your form, set your form's action URL to Formpaste's endpoint, and add your access key.
Create your form
Sign up, verify your email, and create an access key in your dashboard.
Copy the code
Paste the snippet above into your project. Pick CSS or Tailwind to match your site.
<script lang="ts">
const ENDPOINT = "https://api.formpaste.com/submit";
let step = 0;
let data = { name: "", email: "", message: "" };
async function submit() {
const body = new URLSearchParams({ access_key: "YOUR_ACCESS_KEY_HERE", ...data });
await fetch(ENDPOINT, { method: "POST", body });
}
</script>
<form on:submit|preventDefault={submit}>
{#if step === 0}
<input bind:value={data.name} placeholder="Name" required />
{:else if step === 1}
<input type="email" bind:value={data.email} placeholder="Email" required />
{:else}
<textarea bind:value={data.message} placeholder="Message" />
{/if}
{#if step > 0}<button type="button" on:click={() => step--}>Back</button>{/if}
{#if step < 2}<button type="button" on:click={() => step++}>Next</button>{:else}<button type="submit">Submit</button>{/if}
</form>
Add your access key
Replace the placeholder with your access key to start receiving submissions.
<input type="hidden" name="access_key" value="YOUR_ACCESS_KEY_HERE">SvelteKit multi-step form FAQ
Paste a form. Get submissions.
Instantly without setting up any backend, servers or databases. 250 submissions/mo free - no credit card.