Opened 18 years ago
Closed 18 years ago
#2014 closed enhancement (fixed)
[patch] Error messages of RequiredIfOtherField* validators are not userfriendly
Reported by: | Steven Armstrong | Owned by: | Jacob |
---|---|---|---|
Component: | Validators | Version: | dev |
Severity: | normal | Keywords: | |
Cc: | Triage Stage: | Ready for checkin | |
Has patch: | yes | Needs documentation: | no |
Needs tests: | no | Patch needs improvement: | no |
Easy pickings: | no | UI/UX: | no |
Description
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.
e.g.:
RequiredIfOtherFieldEquals('action', 2)
becomes:
RequiredIfOtherFieldEquals('action', 2, 'Forward Message to')
This is a backwards compatible change.
Attachments (2)
Change History (8)
by , 18 years ago
Attachment: | required-if-other_label-insteadof-value.patch added |
---|
comment:1 by , 18 years ago
Type: | defect → enhancement |
---|
comment:2 by , 18 years ago
Component: | Admin interface → Validators |
---|
comment:3 by , 18 years ago
Owner: | changed from | to
---|---|
Status: | new → assigned |
by , 18 years ago
Attachment: | required-if-other_label-insteadof-value_with-docs.diff added |
---|
Patch with docs. You might want to check the docs and rephrase if necessary. English is not my native tounge.
comment:4 by , 18 years ago
Triage Stage: | Unreviewed → Ready for checkin |
---|
Great addition!
It needs docs (in forms.txt); can you add 'em so I can check this in?