Opened 16 years ago
Last modified 14 years ago
#7911 new enhancement
Optional validation for custom fields
Reported by: | Owned by: | ||
---|---|---|---|
Priority: | normal | Milestone: | unscheduled |
Component: | ticket system | Version: | none |
Severity: | normal | Keywords: | ticket custom field validation consider |
Cc: | Branch: | ||
Release Notes: | |||
API Changes: | |||
Internal Changes: |
Description
JQuery permits a nice environment to build custom/dynamic drop-down lists for custom fields in trac tickets; unfortunately validation for the ticket fails as the dynamic value for a field with an option list cannot be found in the configuration file.
At least two solutions are possible:
- Add an option for turning off validation in comparing the value against the option list, and
- Allow for dynamic validation.
I have implemented the solution for #1 (attached).
Attachments (1)
Change History (7)
by , 16 years ago
Attachment: | custom-field-optional-validation.patch added |
---|
comment:1 by , 16 years ago
Option 3, leave it as a text field in trac.ini and handle setting up the options in a pre-req filter. This seems too case-specific.
follow-up: 3 comment:2 by , 16 years ago
If you're already depending on JavaScript to populate the options, why not leave it as a text field (so that people without JS can still use it) and use JS to convert it to a select and populate all the options from there.
comment:3 by , 16 years ago
I'm already conditionally swapping between a text field and a select. The reason I left it as a select is that Custom Query can utilize it (at least to group by) when it is a select.
Replying to ebray:
If you're already depending on JavaScript to populate the options, why not leave it as a text field (so that people without JS can still use it) and use JS to convert it to a select and populate all the options from there.
follow-up: 5 comment:4 by , 16 years ago
Keywords: | consider added |
---|---|
Milestone: | → 0.13 |
So, IIUC, you're requesting a kind of "opened" list custom field type, with predefined values but not limiting ones, right?
comment:5 by , 16 years ago
That's another excellent interpretation. In my scenario, the predefined value list may be empty as it would change based on the content of other fields. There may be scenarios that have a few common list items.
Replying to cboos:
So, IIUC, you're requesting a kind of "opened" list custom field type, with predefined values but not limiting ones, right?
comment:6 by , 14 years ago
Milestone: | next-major-0.1X → unscheduled |
---|
Patch to implement custom field optional validation