Decide these first
Two choices change what you build. Settle them up front and take everything else from the defaults below.- Partial submissions (multi-step forms). Saving answers as people go lets the owner see where they drop off and follow up. Use it for applications, leads and orders. Leave it off for anonymous surveys, where storing unsent answers breaks the anonymity respondents expect.
- What happens with submissions. A review dashboard (recommended), an email on each submission, a Slack message, a confirmation email to the respondent.
Respondent experience
- Multi-step forms open with the title, one line on their purpose and an honest time estimate. They show progress (“Step 2 of 4” and a bar, counting only the steps branching will show) and keep answers on Back. Next validates the current step only.
- Order questions easy before hard. With partials on, ask for name and email early so a drop-off can be followed up. Sensitive and optional questions go last.
- Branching: derive the visible steps and fields from the current answers, and leave answers to hidden questions out of the payload so stale data isn’t saved.
- In one-question-per-screen layouts, picking a single choice or pressing Enter advances. Multi-select and long text wait for Next.
- Keep a multi-step form’s draft in
localStorageunder a key unique to the form, offer “Continue where you left off”, and clear it on submit. Losing answers on a reload is the most common way long forms get abandoned. Pages render on the server first, where there is nolocalStorage, so read the draft in auseEffect(see Framework overview). - The ending screen, and any confirmation email, say what happened and what comes next (“We reply within 2 business days”). A bare “Thanks!” leaves people unsure it worked.
- Lay the form out as a centred column about 600px wide, with one primary action per screen and Back as a quiet secondary. A
fillout-embed-typeURL param means the form is embedded on someone’s site: drop the page background and header so it sits in the host page.
Fields
- Labels sit above the input and stay visible. Placeholders carry format examples only, since they vanish once someone types.
- Pick the control by the shape of the answer:
- a few options: radio buttons or clickable choice cards
- longer lists: a
Select, searchable once it’s long - yes or no: two buttons
- ratings: a segmented 1–5, or 0–10 with labelled ends for NPS
- Set
typeorinputMode, andautoComplete(name,email,tel,organization,street-address,postal-code), so phones show the right keyboard and autofill works. - Phone: a country select plus the number, stored as E.164. Address: separate fields, or Places autocomplete when Google Maps is connected (see Maps).
- Files: a drop zone that also opens the picker on click, with the allowed types and max size stated up front, and each picked file’s name, upload state and a Remove button. See File uploads.
- Signature: a canvas pad with a Clear button, uploaded as a PNG through
useUploadfromzitejs/upload. Store the image URL, the typed name and a timestamp.
Validation
- Write one zod schema per step, and compose them into the submitting server function’s
.validator(). The function is public, so it validates everything the client sent again. - Validate a field when it loses focus, then live once it shows an error, so nobody is flagged mid-word. Errors sit under the field and say how to fix it (“Enter an email like name@company.com”). A failed Next or Submit focuses the first invalid field.
- Tie each error to its field with
aria-describedbyand announce it. Group choices withfieldsetandlegend. A step change moves focus to the new step’s heading, so keyboard and screen-reader users know where they are. - Submit stays enabled, so a click can explain what’s missing, and shows a spinner while the request is in flight. On a network failure, keep every answer and offer Retry.
Submissions
- Use one table per form, with one field per question of the matching type, plus a
statussingle select with stages that fit the domain (for example New, Reviewing, Accepted, Rejected). Public forms also storesourceand the UTM params read from the URL on first load. - Prefill fields from URL params where it makes sense (
?email=,?ref=). Owners use these in campaigns and emails. Read them with the route’svalidateSearchandRoute.useSearch(). - The client creates a
submissionIdwhen the form starts and keeps it with the draft. The server function upserts on it, so partial saves, retries and the final submit all land on one record. With partials on, each Next saves withstatus: Partialand alastStepfield, which the dashboard’s drop-off funnel counts. - The server function writes the record first, then runs side effects (emails, Slack, integrations) only the first time a record reaches a submitted status. Wrap each side effect in try/catch with logging, so a failing integration never loses a submission and a retry never sends twice.
- Emails to the owner or their team (a copy of each submission, a digest) go out through Zite’s built-in email, which needs no connection. If the workspace has no
emailintegration yet, add"email": { "type": "email", "provider": "zite_email" }underintegrationsin the rootzite.config.json, and"email": {}to the app’sintegrationSettings. You don’t needsetup_integrationfor it. See Email. - Some accounts must complete account verification before the built-in email sends. A send refused for that reason fails with an error that links to the verification.
- When the form also emails respondents, connect your own email account as the
emailintegration’s provider instead: respondents see who an email is from, and one account then sends both. - Spam: public server functions already have platform rate limiting. Add a honeypot field (visually hidden,
aria-hidden,tabIndex={-1}) and accept its submissions but silently discard them. Leave out time-to-submit checks, since prefilled and autofilled forms are legitimately fast. - Deadlines and response caps, when you need them, are enforced in the server function and exposed as a status the form reads on load, so it opens on a closed screen instead of failing at submit.
- Submissions made in the editor preview are saved like real ones. Delete them from the database when you’re done testing.
Example: saving progress and submitting
TwopublicFn server functions share one record per submissionId: saveProgress on each Next, submitApplication at the end. Both validate with the per-step schemas, and both leave a record alone once it has been submitted.
submissionId in the browser and keep it with the draft:
Defaults by form type
Review dashboard
Build the dashboard as its own app (create_app) with accessMode set to internal. The form is public, submissions should be visible only to the team, and access is set per app (see Access and sign-in). Alongside a table of submissions, it has:
- A detail view with the answers grouped as on the form, under the question labels (not field names), with previewable files and the signature image.
- Status changes and internal notes.
- An overview: submissions over time, breakdowns of the main choice questions and, with partials on, a funnel from started through each step to submitted. Compute these with SQL, as in Dashboards with SQL.
- CSV export of the current filtered view.