Validator: Field validated class
See original GitHub issueHi @icebob @dflock @cristijora,
I need a validated state (class) for my fields.
I noticed in the source that there is a validationSuccessClass
and by setting it with validationErrorClass
, I can get a class that currently correspond to “no error”.
But “no error” and “validated” don’t have the same meaning. A field should have 3 states : “normal”, “error” and “validated”.
With validateAfterLoad: false, validateAfterChanged: false
, I want my field to be “normal” until I trigger a validation. Then all fields are either “error” or “validated”.
With validateAfterLoad: false, validateAfterChanged: true
, I want my field to be “normal” until I edit the field. Then this field is either “error” or “validated”.
With validateAfterLoad: true, validateAfterChanged: false
, I want all my fields to be either “error” or “validated” after initial load. They keep their state until I trigger a validation.
With validateAfterLoad: true, validateAfterChanged: true
, I want all my fields to be either “error” or “validated” after initial load. They keep their state until I edit the field.
With this behavior, it will be possible to add a checkmark or anything I want next to each “validated” field. It will allow my users to see their progress on the from.
TL:DR The goal is to have a class that mean “I have been through the validation process at least once and I have no error”
How can we achieve that ? I can do a PR if necessary but I wanted your opinion on the issue first.
Thank you !
Issue Analytics
- State:
- Created 6 years ago
- Comments:9 (6 by maintainers)
Hello @icebob , I’ve been extremely busy at work. I will try to catch up with the updates, and see if what I did at that moment is still working now. I have some catching up to do !
Since this is used by all fields, I think we should at least namespace the internal properties with
vfg
or something like that. So with your proposition, that would createvfgTouched
andvfgValid
(orvfg_touched
andvfg_valid
). Is that ok for you @cristijora ?