Preserve effort
In-memory snapshots restore programmatically cleared values after failure while protecting fields edited during the request.
Accessible workflow infrastructure · v1.0.0
A11yFormSubmissionRecovery preserves form values, blocks duplicate requests, distinguishes validation, network, and server failures, and provides a safe path to retry.
It enhances a real native form, uses no runtime dependencies, and leaves server validation and idempotency with the application.
In-memory snapshots restore programmatically cleared values after failure while protecting fields edited during the request.
One synchronous active-attempt guard blocks repeat submissions before validation, hooks, or transport work can overlap.
Validation, network, retryable server, and non-retryable server results produce distinct typed outcomes and polite status text.
Retry is always a user command. Online events and uncertain navigation outcomes never trigger a background submission.
The state machine is the only workflow-state authority.
submitting and retrying are the only
active states.
| State | Meaning |
|---|---|
idle | No attempt is active. |
submitting | A first attempt is active. |
succeeded | The response was classified as successful. |
validation-failed | Client or server validation needs correction. |
network-failed | The request could not be confirmed. |
server-failed | The service returned a non-success response. |
retrying | An explicit retry is active. |
npm install a11y-form-submission-recovery
import {
createFormSubmissionRecovery
} from "a11y-form-submission-recovery";
import "a11y-form-submission-recovery/styles.css";
const form = document.querySelector(
"[data-a11y-form-submission-recovery]"
);
if (form instanceof HTMLFormElement) {
createFormSubmissionRecovery(form);
}
Use one directory to find successful submissions, failure states, manual recovery, official addons, support details, integration recipes, privacy guidance, and a Spanish localization example.