Skip to main content
Svelte forms can post directly to Formbase or submit with JavaScript. This guide shows a programmatic submission so you can update UI state and handle errors gracefully. Remember: browser submissions return a 303 redirect, so treat that status as success.
1

Create the form

Bind inputs to name attributes and prevent the default submit.
2

Send the submission

Svelte passes the form element via event.currentTarget.
For a JSON response, forward submissions from a server endpoint or server action.