Form Action
Server action that validates, persists, redirects, or returns errors while preserving native form behavior.
Core Idea
A form action is a server function that receives plain HTML submissions, validates the payload, writes data, and returns structured results to the client. Because SvelteKit actions sit beside the page component, they preserve the progressive enhancement promise: the form still submits without JavaScript, yet enhanced behaviors such as use:enhance or inline error states can layer on top.
Why It Matters Here
Mathbong's Svelte series builds resilient school workflows. Form actions keep validation, persistence, and optimistic responses close to the UI, so the same code path powers basic browsers and enhanced experiences. They are the anchor for topics like progressive enhancement and the optimistic UI flows we reuse in later lessons.