Prevent errors

Error Prevention

Language

Error prevention beats error messages: constrain inputs, confirm destructive work, offer undo, and design defaults that match the common safe path.

Dangerous action guard pattern
Slow people down only when stakes are high.
Wireframe with disabled invalid option
Prefer prevention over red error text.

Forgiving inputs

Masks, format-as-you-type, autocomplete, and server-side normalization reduce typos before they become validation failures.

Confirmations

Use typed confirms for irreversible actions; rely on undo for reversible ones. Frequency matters — don’t train users to skip dialogs.

Defaults and constraints

Disable impossible combinations, gray out invalid dates, preselect shipping aligned with inventory. Explain why something is blocked.

Practices

  • Double confirmation only for irreversible harm.
  • Autosave drafts in long editors.
  • Disable submit until required fields valid.

Common pitfalls

  • Blaming users in copy (“Invalid input”).
  • Confirm dialogs for every minor action.
  • No undo after soft delete.