[patch] Error messages of RequiredIfOtherField* validators are not userfriendly
|Reported by:||Steven Armstrong||Owned by:||jacob|
|Cc:||Triage Stage:||Ready for checkin|
|Has patch:||yes||Needs documentation:||no|
|Needs tests:||no||Patch needs improvement:||no|
When working with RequiredIfOtherFieldEquals and RequiredIfOtherFieldDoesNotEqual validators the error messages can be quite user unfriendly.
Assuming you have a select-box named 'action' where the currently selected option has a value of 2 and a label of 'Forward Message to' you get error messages like:
This field must be given if action is 2
That sort of let's the user sit there feeling dumb. 2, where does that 2 come from and what does it mean ???
With the attached patch applied you can have error messages like:
This field must be given if action is Forward Message to
The label is passed as a third, optional, argument to the validators constructor.
RequiredIfOtherFieldEquals('action', 2, 'Forward Message to')
This is a backwards compatible change.
Change History (8)
Changed 9 years ago by anonymous
comment:3 Changed 9 years ago by jacob
- Owner changed from adrian to jacob
- Status changed from new to assigned
Changed 9 years ago by Steven Armstrong
comment:4 Changed 9 years ago by SmileyChris
- Triage Stage changed from Unreviewed to Ready for checkin