Form Submission
4 min read
The user fills out a form and clicks Submit. What happens between the click and the success page determines whether the form feels responsive or laggy. There are three layers to tune — pre-action feedback, optimistic submission for low-rejection cases, and determinate progress for the long tail — and they stack to push the perceived submission time below Doherty 1982's Doherty 1982 productivity-cliff.
This scenario spans bands. Most submissions land in the 1 – 10 S band on the wall clock; the perception layer is what compresses them into the 0 – 100 MS or 100 MS – 1 S band the user actually feels. Fitch's Fitch 200 ms active-state animation covers the press feedback; Myers 1985 Myers 1985 covers the determinate-progress fallback.
Optimistic State Update
Click the heart. Naive: button waits for the server, the count updates only after the round-trip. Tuned: optimistic flip, background commit, visible rollback on the rare failure (~10 %).
Off
On
What is happening in the demo
The optimistic-actions demo stands in for the form submission: the naive side waits the full server round-trip before flipping state; the tuned side flips immediately and reconciles in the background. For a real form submission, the tuned side stacks three things:
- Pre-action feedback within ~50 ms. The submit button shows a
:activestate plus a 200 ms press animation as soon as the user clicks. Even if the actual submission takes 3 s, the press is acknowledged inside the perceptual frame. - Optimistic UI when rejection rates are low. Render the success state immediately; reconcile with the server in the background. For a checkout submission with a 1 % rejection rate, this is a free win 99 % of the time and a recoverable error 1 % of the time.
- Determinate progress when submission lasts past 1 s. Past the active-to-passive transition, a determinate progress bar with backwards-decelerating ribs keeps the user oriented.
The decision tree: rejection rate above ~5 % → skip optimistic, use determinate progress; rejection rate below ~1 % → optimistic with honest visible failure path; in between, lean toward optimistic if the user can recover from the failure cheaply.
What to tune
- Pre-action — submit button echo within ~50 ms; 200 ms active-state animation (Fitch). Always.
- First 1 s — for low-rejection submissions, optimistic UI flips to the success state. For high-rejection submissions, hold the button in a loading state without committing.
- 1 – 10 s — determinate progress bar with backwards-decelerating ribs (Harrison 2010, +11–12 %).
- Rollback —
role="alert"message; focus moves to the failed field; the user's input is preserved across the rollback. - Completion — focus lands on the next surface's main heading or success affordance, not a generic "Submitted" toast.
When perceived performance hurts you here
The optimistic pattern fails when the rejection rate is too high (covered in detail at optimistic-actions). The other failure mode specific to forms: an optimistic submission that loses the user's input on rollback. If the user typed for two minutes and the rollback discards the form data, the perception layer became a tax — the optimistic flip felt great, the rollback was catastrophic.
The fix: preserve the form state across rollbacks. Re-display the form with the user's input intact, surface the failure inline, let them retry from where they were. Most React form libraries (React Hook Form, Tanstack Form) handle this if configured correctly; raw useState form state usually doesn't.
For multi-step forms with non-trivial state, pair this scenario with the multi-step wizard / checkout pattern: prefetch the next step's bundle on the current step's near-completion, optimistically navigate, and roll back to the previous step on validation failure.
Accessibility
aria-pressedon toggle-form buttons reflects the optimistic state.role="alert"on the rollback message — the user thought their submission succeeded.- Don't lose mid-flight user input — if the user is still typing in another field when the optimistic submission fails, the rollback must not clobber their work.
- Focus management on rollback — move focus to the failed field (or to the error message) so keyboard users find the problem.
prefers-reduced-motion: reducefor the press animation — collapse to a colour change.
Other patterns that fit
Same band, same surface — switch in whichever maps best to your UI.
Optimistic Icon Flip
A heart, a star, a bookmark. Naive: the icon waits for the server before it fills, so the user feels the round-trip on every press. Tuned: the icon flips instantly; the server commit reconciles in the background. At ~99 % success the experience is sub-perceptible feedback; at the rare ~1 % failure, the icon visibly rolls back.
Off
Click. The heart waits for the server before filling.
On
Click rapidly. The heart flips on press; ~10 % of the time the server rejects and you'll see a visible rollback.
Backwards-decelerating Progress Bar
Two bars, same actual duration. Naive: linear fill from 0 → 100 %. Tuned: same fill, but eased to be fast at the start and slow as it approaches the end, with backwards-moving ribbed pattern overlaid. Harrison et al. 2010 measured ~11–12 % perceived speed-up vs. linear at the same real wall-clock time. Free perception with no engineering cost.
Off
Press Run to start
On
Press Run to start
Mousedown vs. Click Head-start
Same button, same work. Naive: fires on `click` (after the user releases the mouse). Tuned: fires on `mousedown` (the moment the press begins). The user holds the button down for ~100–150 ms — that whole window is free latency budget you reclaim by starting work earlier.
Off
Press the button. Hold a beat before releasing.
On
Press the button. Hold a beat before releasing.
References · 3
- Doherty 1982
Doherty, W. J., & Thadani, A. J. (1982). The Economic Value of Rapid Response Time. IBM Technical Report GE20-0752-0. Sub-second response on submit clears the productivity-cliff bar even when the underlying server work is slower.
- Myers 1985
Myers, B. A. (1985). The importance of percent-done progress indicators for computer-human interfaces. Proceedings of CHI '85, 11–17. Determinate progress beats blank wait — applies once submission lasts longer than ~1 s.
- Fitch
Fitch, E. Perceived Performance: The Only Kind That Really Matters (conference talk). The 200 ms active-state animation sweet spot on the submit button.