Sub topic 12
The Review Step and Final Submission
Assume you know basic HTML form elements, JavaScript or TypeScript, and how a browser submits form data. This chapter focuses on the last part of a multi-step flow: checking the collected answers, sending them, and recovering when the request fails.
What the review step does
A review step gives users one place to verify their answers before creating an account, placing an order, or sending an application. It should show:
- Every value that will be submitted.
- The group or step where each value was entered.
- An Edit action that returns to the correct step.
- A final action with a specific label, such as Place order or Create account.
Do not ask users to compare the review page with earlier screens from memory. Format values as users expect to see them. For example, display a date as “November 28, 2026” and a boolean as “Yes” or “No”, rather than showing raw database values.
The review screen must use the same active-field rules as submission. A field hidden by a conditional choice should not appear in the review and should not be sent to the server.
| Review concern | Design decision |
|---|---|
| Missing value | Show an actionable error and an edit link |
| Sensitive value | Mask it when full display is unsafe |
| Changed answer | Return to its owning step |
| Final action | Disable duplicate activation while submitting |
Build and validate the final payload
Before submission, derive a new payload from current state. Do not blindly serialize every control in the page. This prevents stale answers from hidden branches from leaking into the request.
Run final validation even if each step validated earlier. Values can change through back navigation, restored drafts, browser autofill, or code changes. Final validation is the last client-side check before the server receives the request. The server must validate again because client-side checks can be bypassed.
type Values = Record<string, string>;
type SubmissionState =
| { status: "idle" }
| { status: "submitting" }
| { status: "success"; reference: string }
| { status: "error"; message: string };
function buildPayload(values: Values): Values {
const payload = { ...values };
if (payload.delivery !== "ship") {
delete payload.address;
}
return payload;
}
async function submitFinal(
values: Values,
send: (payload: Values, key: string) => Promise<{ reference: string }>
): Promise<SubmissionState> {
const payload = buildPayload(values);
const idempotencyKey = crypto.randomUUID();
try {
const result = await send(payload, idempotencyKey);
return { status: "success", reference: result.reference };
} catch {
return {
status: "error",
message: "We could not submit your form. Your answers are still here. Try again.",
};
}
}Handle failure and duplicate submission
Submission is asynchronous, which means the browser waits for a server response. During this time:
- Keep the user's values in memory and in the draft store.
- Show progress on the final button, such as Submitting….
- Prevent a second click or Enter key from starting another request.
- Restore the button if the request fails.
- Move focus to the submission error so keyboard and screen reader users notice it.
A timeout is ambiguous. The server may have accepted the request even if the response never reached the browser. Use an idempotency key, a unique value for one intended submission, so the server can return the original result when it receives the same request again. Do not create a new key for every retry of the same attempt.
After success, replace the form with a confirmation that includes a reference number or next step. Do not leave the final button active behind the confirmation.
Exercise
Exercise
Why should a retry use the same idempotency key when the first request times out?
Show answer
The server may have processed the first request. The same key lets it recognize the retry as the same intended submission instead of creating a duplicate.