State format rules before input, not after submit
Aliases: error prevention format · post-submit format message · constraint timing
What it is
How a date is written, how many character classes a password needs, whether a number contains hyphens—if those constraints first appear after Submit, the whole string has already been built on the wrong model. A pre-input format constraint makes the rule visible before the first keystroke, so assembly aims at a legal shape. The issue is when the rule appears, not whether it is an example or an abstract sentence, and not whether it remains after an error.
Why it happens
People form a hypothesis of “what a cell like this looks like,” then type the string in one run. A post-submit red line overthrows the hypothesis after it has already been executed: the string is scrap, working memory is cleared, and a rule that was invisible a moment ago must be read. A visible-in-advance constraint moves hypothesis formation earlier; keystrokes are attracted to the rule’s shape (how many groups, whether symbols), and errors are blocked during assembly. That is prevention, not prettier error copy. Delay until submit also has a social cost: a public error banner announces failure, and people rush a fix or quit.
Studying it
Have people fill the same format when the rule is told after submit, on focus, or already on render. Record legality of first submit, full-string rewrites, and time. Factors: constraint complexity, paste allowed, prior familiarity. Outcomes: first-submit legality, the moment the rule is first read (eye tracking can mark it). The classic error-prevention logic still applies: the same sentence before the action cuts rework more than after failure. Do not credit inline validation’s success to a pre-input hint—validation is still after the fact, only sooner.
Where it stops holding
Universally known formats (a domestic mobile number) already have high first-submit legality, so a pre-input hint adds little. Constraints that change by region or account policy must change in the pre-input sentence too, or the hint teaches an expired rule. Some security rules (password must not match a previous one) cannot be honestly stated up front because they depend on a server-side secret; those stay post hoc—do not pretend prevention covers them. A long rule list delays starting; the pre-input hint becomes an unread manual.
Applying it
- Write must-obey formats beside the field before typing starts; do not save the first telling for a red line after Submit.
- Move “we only found out after submit” rules to the matching slot’s pre-input place, rather than stacking one global error at the top.
- For rules that truly can only be judged later (conflict with an old value, server uniqueness), say up front that this one waits on submit, so people do not take the pre-input list as exhaustive.
- Verify by forbidding post-submit errors and filling from pre-input copy alone. If first-submit legality stays low, the rule still lives in the failure state.