No Code Attached Yet
avatar stephan-ansems
stephan-ansems
14 May 2022

The request

Implement a requiredon attribute to (core) fields similar to the showon attribute to enable conditional requiredness of form fields.

Why is this useful?

Some argue that having to toggle the requiredness of a field is a design flaw in the form, however I believe that it is not. For example a form to specify OAuth2 settings could have a dropdown to indicate the grant type. Depending on the grant type chosen, the form can change quite drastically. Some fields are not relevant for certain grant types and can be hidden, others are no longer required. The problem with only showon is that you can hide these fields, but a hidden field still remain required.

The Feature Request

Implement an attribute to the field specification named requireon that accepts conditional statements identical to that of the showon attribute. However the effect is to toggle the required attribute (and the little star next to the label)

The gift

I've got a working implementation for Joomla 4.x. in a simple zipfile which could be applied to an installed (and configured) Joomla installation for testing. since it overwrites some of the original Joomla files I see no way to implement this as a plugin or other form of installable...

Votes

# of Users Experiencing Issue
0/1
Average Importance Score
4.00

avatar stephan-ansems stephan-ansems - open - 14 May 2022
avatar stephan-ansems stephan-ansems - change - 14 May 2022
Labels Removed: ?
avatar joomla-cms-bot joomla-cms-bot - change - 14 May 2022
Labels Added: No Code Attached Yet
avatar joomla-cms-bot joomla-cms-bot - labeled - 14 May 2022
avatar stephan-ansems stephan-ansems - change - 14 May 2022
Status New Closed
Closed_Date 0000-00-00 00:00:00 2022-05-14 15:28:30
Closed_By stephan-ansems
avatar stephan-ansems stephan-ansems - close - 14 May 2022
avatar stephan-ansems
stephan-ansems - comment - 14 May 2022

I'll create a pull request...

Add a Comment

Login with GitHub to post a comment