Description
Field Validations are a way of talking to our users. It is designed to make the user understand a mistake and the ways to correct it.
Example:
Types
Type | Usage |
---|---|
Field validation error | Alerting the user on actions that will not allow him to complete the task. |
Field validation warning | Alerting the user on actions that might contain a mistake or a non fatal error. |
Usage & Behaviour
Internal Logic
All input fields will display the value entered by the user. If the input is invalid, an indication for invalid/warning will be displayed. Prevention of input is not allowed (e.g. typing on the keyboard “A” and not displaying it in the field)
Triggering the validation is set by 3 types:
Syntax validation - validation should be displayed while typing.
For example:An illegal character was typed (e.g. numbers instead of alphabetic)
Exceed the number of characters (e.g. user input 3 digit number where only 2 digits is allowed)
Logical validation - any validation that is set on the required value (e.g. Max. input of 100)
In most cases, the validation will occur after the user left the field
Missing input on a required field
Validation is displayed as soon as the user leaves (out of focus) the required input field which has no input
Note: when a form has a single required field, the validation will appear only after the user tries to submit the form (Submit button is enabled)
Autocorrect - Some cases require an automatic correction of the invalid input.
The components Pagination and Slider with a numeric input, which have a clear visible definition of a numeric range, will behave as follow.
An invalid value will be indicated.
On OutOfFocus (e.g. user clicked somewhere outside the field) the entered value will automatically change to:
Last valid
Edge range - if the input exceeds the range of options(e.g. in pagination “0” will auto-correct to the “1” )
Connected fields - where different fields are dependent on each other and the numeric range is dynamic.
On OutOfFocus with an indicated invalid input, a pop-up message will appear with the options of:Back - returns the focus to the field with the last used input
Revert - returns the focus to the field with the latest valid input (the one before the user changed it)
See pop-up example:
Default input/validation
When starting to edit a field with a validation indication on it, the current indication will be hidden (i.e. it will be treated as if the user had edited the field for the 1st time).
If the user had entered a form/page/screen for the first time (fields are empty), logical validation should not be enabled. However, syntax validation should be enabled.
In cases where the user enters a page that already had input, the warning validation should be displayed (e.g. the user enters a page already edited with warnings in it).
Structure
The field validation consists of:
Color frame or & a Small icon on the top right corner - marks the validation type
A validation tooltip message appears upon hover of the validated field/component
A descriptive message next to the submit button
Error messages have a higher priority than a warning. In case the error was fixed, the warning validation should be presented.
In some cases of limited space or a short form, no descriptive message will appear
Examples:
Text position:
Text position can be either near the CTA (right-aligned) or at the beginning of the row (left-aligned) according to size and available width
See examples:
Content
Descriptive text on the actions row (e.g. Submit)
If only 1 field didn't pass validation, the text near the CTA should be the same as the tooltip
If both Warning and Error are found, the text should address the Error
If multiple fields didn't pass validation of the same type, the text near the CTA should be "X warnings found" <<TBD with Docs.>>
In cases where the text is very long, the section should get a scroll
For example:In general
Specify why field info was not accepted - your validation messages should tell users exactly why their information got rejected or may have some risk
If the values entered may impact some other part of the system, briefly explain what may be impacted
Keep it short!
Rephrasing examples (taken from Verint's Suite):
Before | After |
---|---|
Percentage must be an integer | Please enter only numbers (e.g 48) |
Max number of bids allowed (8) for this auction exceeded | You have reached (11) the maximum bids allowed (8) for this auction. Please remove 3 bids. |
Not a valid number, please enter length in minutes | Please enter length in minutes (e.g. 30) |
Invalid selection for employees - single or group | You can select a single employee as well as a single group or organization (not both) |
The form has errors | Please complete all mandatory fields |
Interaction
Validation tooltips
Any field/tab that has validation indication will also have a tooltip
The validation tooltip takes priority over any other tooltip (if exists)
Location of the tooltip is by default on the right of the field except when there is no space
Tooltip timing should be - Tooltips (see interaction section)
Warning and Error has the same tooltip interaction
Tooltips positioning examples:
Content | Examples | Comments |
---|---|---|
1 or more rows of text right to the icon of validaton | ||
Partial coverage of control | User can still click the control | |
Left position |
Best Practices
Use field validations for any user input fields
Content Guidelines
2 options for the content of the error message:
Generic
The content of the message is written in advance and there is no need to refer to the specific text that the user typed, for EX: "not a valid zip code"Input based (
Preferred option where applicable)
The content of the message can dynamically change based on the input of the user, use it to clarify to the user where the error is coming from.
Some examples:Invalid input → zip code cannot contain the special character: "%"
You cannot book this flight, please select another destination or date → Direct flights to Dublin are only available in August. Please select another destination or date
For complicated fields, an example in the text of the tooltip can help
Try to avoid negative words
(e.g. "Password does not meet requirements" or "Invalid Password" → could be turned into→ "Password must contain 8 alphanumeric characters")
Accessibility compliance
Focus management
Used as any component with a tooltip
Screen reader support
Screen reader should read a loud the state of the field once the user focuses on it.
Contrast & size compliance
Should be A11y complied
Design
Zeplin link | Screen thumbnail |
---|---|
https://app.zeplin.io/project/5970b366bee38cf87b2de932/screen/5baca0fa7044c49e813fe220 | |
https://app.zeplin.io/project/5970b366bee38cf87b2de932/screen/5baca11066034667cc35f576 |
Code
<<a box containing the code - discuss with Femi>>