Accessible workflow infrastructure · v1.0.0

Keep form submissions recoverable.

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.

Built for difficult submission moments

Preserve effort

In-memory snapshots restore programmatically cleared values after failure while protecting fields edited during the request.

Prevent duplicates

One synchronous active-attempt guard blocks repeat submissions before validation, hooks, or transport work can overlap.

Explain outcomes

Validation, network, retryable server, and non-retryable server results produce distinct typed outcomes and polite status text.

Retry deliberately

Retry is always a user command. Online events and uncertain navigation outcomes never trigger a background submission.

Seven-state model

The state machine is the only workflow-state authority. submitting and retrying are the only active states.

StateMeaning
idleNo attempt is active.
submittingA first attempt is active.
succeededThe response was classified as successful.
validation-failedClient or server validation needs correction.
network-failedThe request could not be confirmed.
server-failedThe service returned a non-success response.
retryingAn explicit retry is active.

Install

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);
}

Explore the examples

Use one directory to find successful submissions, failure states, manual recovery, official addons, support details, integration recipes, privacy guidance, and a Spanish localization example.

Browse every example