[MGNLUI-171] Allow instant validation of form fields Created: 15/Nov/12  Updated: 08/Mar/21  Resolved: 08/Mar/21

Status: Closed
Project: Magnolia UI
Component/s: forms
Affects Version/s: 5.2
Fix Version/s: None

Type: New Feature Priority: Neutral
Reporter: Jozef Chocholacek Assignee: Unassigned
Resolution: Obsolete Votes: 0
Labels: ux, validation
Remaining Estimate: Not Specified
Time Spent: Not Specified
Original Estimate: Not Specified

Template:
Acceptance criteria:
Empty
Date of First Response:
Epic Link: UI framework: depending issues

 Description   

It would be nice to have an instant (i.e. before form submission) validation possibility of some fields in forms, e.g. when adding new user/group, then user should get a warning that the desired user/group name already exists before (s)he clicks the "Save" button.

There are some constraints from the UX point of view (from my discussion with Andreas):

In general, the following things are important when we do validation before form submission:
1. only do that on complex fields (e.g. a date or a credit card number)
2. or on fields where you need to comply with a set of rules (username is a good example, as it might still be free or not)
3. Do NOT show an error or problem, if the field is still empty. Only start doing so, once the user starts filling in a value in the field.



 Comments   
Comment by Andreas Weder [ 15/Nov/12 ]

Here's the rationale behind not having instant validation for every field.

There's a common mistake shown in UI books where there's instant validation on "first name" and "last name" fields. Those examples show an error when the field is empty and show a green tick icon when it has been filled in. The error is confusing as there actually is no error yet, even if the field is required. The green tick seems to confuse some users in that they wonder whether it means that "what, have I written my first name right?"

This is a good example for why these constraints mentioned in the description of this issue are in place. For once, "first name" and "last name" are not fields that require any instant validation. They are simple to use and require no further guidance. Even if they are required, that should only be checked and the fields then marked as missing a value once the form is submitted.

Good positive examples are:

  • a number field requires that its value are within a given range
  • a date field requires its value to follow a specific format (it should also offer a date picker in addition to that)
  • a username field could immediately check if the username is chosen is still available
Comment by Roman Kovařík [ 08/Mar/21 ]

Closing as already fixed by upgrade to Vaadin8.

Generated at Mon Feb 12 08:34:17 CET 2024 using Jira 9.4.2#940002-sha1:46d1a51de284217efdcb32434eab47a99af2938b.