[Patternfly] Fwd: UI indicating field is required

Andreas Nilsson anilsson at redhat.com
Thu Jul 3 13:57:59 UTC 2014


On 07/03/2014 03:42 PM, Robb Hamilton wrote:
>
> there was another request this week for rules regarding form 
> validation.  specifically, how to handle the validation of password 
> inputs when creating a new password where the password has to be input 
> twice (does this happen client-side, server-side?  what messaging 
> appears and when?  etc.).

We're currently working on solving this in Cockpit here: 
https://github.com/cockpit-project/cockpit/issues/739 and the pull 
request https://github.com/cockpit-project/cockpit/pull/809 but it would 
be great to have this code live in Patternfly instead of locally in our 
cockpit-accounts.js
So here is the current behaviour:
* On error, both fields turns red, since the error refers to both fields 
and the typo of your regular password could have happened in the first 
field.
* The password is getting checked while you're typing. If the secret 
password is "hacker" the fields will turn red already at the "o" if 
typing "hackor" in the second field. This catches typos right away.
* There is a timer of 2 seconds for the second field so it can catch 
things like a missing last "r" in the case of the "hacker" password is 
just "hacke"
* There is certainly room to improve the logic above, but I feel it 
covers at least the basic cases for now.
* There is still a tiny issue in that if you focus the first field with 
the mouse, and then use tab to jump to the second field and do an error, 
the first field will remain red due to the blue hover effect on the 
first field.
- Andreas




More information about the PatternFly mailing list