The showon field attribute is a great feature for selectively modifying a form, dependant on the values of other fields.
However the way it works, by hiding the fields, is not always ideal. It's great for some uses, but in other cases I would prefer that a field is simply disabled rather than hidden.
For example, this would be useful as a visual clue to users to show them what options will become available if they turn a switch on. If the main option defaults to 'off', they may never see the linked fields unless they realize they should turn it on.
I'm not suggesting any changes to showon because it works really well and probably is the best solution in most cases. But I would like to propose an additional attribute enabledon to complement it.
enabledon would work the same way as showon, sharing the logic code for determining the state; the only difference would be what it does to render the effect on the form.
| Labels |
Added:
?
|
||
| Category | ⇒ | UI/UX |
| Category | UI/UX | ⇒ | Feature Request Templates (admin) UI/UX |
| Priority | Medium | ⇒ | Very low |
| Status | New | ⇒ | Needs Review |
| Labels |
Added:
J3 Issue
|
||
After 18 months with no interest from anyone to write the code I am going to close this.
| Status | Needs Review | ⇒ | Closed |
| Closed_Date | 0000-00-00 00:00:00 | ⇒ | 2018-08-18 16:24:25 |
| Closed_By | ⇒ | brianteeman |
These kinds of actions are tricky.
showonis entirely UI driven. Something like that would have to affect the form state and be handled both client side (determine to show/hide enable/disable field) and server side (if a field is marked required with anenabledonproperty as an example).Not saying it's impossible. But it requires a lot more communication between the client and server than the
showonconfigurations need.