Rule 8.7, States

Validate on submit and keep the input

Default

Rule. Validate when the person submits, focus the first error, and keep the invalid input visible and unchanged.

Why. An error while typing scolds an unfinished thought. A rewrite loses the original.

When not. Check a username or a code as the person types only when a check needs the full value.

Do. The typed text stays. The error shows a sample date.

Don't. The app replaced the typed date, and the person's input is lost.