Forms · SU-150
Validate when the person is done, and keep submit enabled
Flip between the version shibroUI flags and the one it ships. The marks and callouts show what changes.
-
Error shown
:invalid after 2 keystrokes
-
Error shown
:user-invalid, on blur
Email
Create account
an
Invalid email
Email
Create account
an
-
Disabled submit label
1.9:1 light · 2.2:1 dark
-
Submit
enabled; explains on press
What changes
- Bad
- An error appears after two keystrokes, and the dimmed submit button (
1.9:1light,2.2:1dark) gives no reason why. - Good
- The field stays quiet while typing, flags problems on blur or submit with
:user-invalid, and submit stays enabled.
The rules
-
SU-150
Validate when the person is done, and keep submit enabled. Validate a field on blur once it's been touched, and always on submit. On input, re-validate only to *clear* an error. Never show errors on untouched fields or while someone is still typing. Style errors with
:user-invalidor[aria-invalid="true"], never bare:invalid. Don't disable the submit button to signal invalid input. Let it submit, then explain.