No Code Attached Yet
avatar frogydiak
frogydiak
1 Apr 2022

Steps to reproduce the issue

Create an xml field and set the shownon attribute to whatever is the value of another field then set the attribute to "required=true". You'll get an error while saving that it cannot be saved because a required data is missing or something like that.

Expected result

Shouldn't it check for "shownon"? If set and not enabled, bypass the field required validation and if enabled then it validate for required value?

Actual result

The validation of required field does not check the field showon attribute value.

Additional comments

I don't know if this is a bug, but looking at it as in an end user perspective it is a bug. First thing that comes to my minds is "That field is not enabled, why do I have to enter a value?" .

avatar frogydiak frogydiak - open - 1 Apr 2022
avatar joomla-cms-bot joomla-cms-bot - change - 1 Apr 2022
Labels Added: No Code Attached Yet
avatar joomla-cms-bot joomla-cms-bot - labeled - 1 Apr 2022
avatar chmst
chmst - comment - 12 Apr 2022

You can define a default value for this field, which is used if the field is not visible on the screen.
I don't remember if ther are reasons for this - but looks like a valid request for me.


This comment was created with the J!Tracker Application at issues.joomla.org/tracker/joomla-cms/37454.
avatar joomdonation
joomdonation - comment - 13 Nov 2022

As of right now, shownon is only used to UI to show/hide fields depends on certain conditions. We do not use it for validating submit form data. Through the years, I have seen several reports like this but we never work on it further.

For the time being, I guess you will have to use default value as suggested by @chmst as a workaround. I'm converting this to discussion to see if we want to work further on it.

avatar joomdonation joomdonation - change - 13 Nov 2022
Status New Closed
Closed_Date 0000-00-00 00:00:00 2022-11-13 10:47:36
Closed_By joomdonation
avatar joomdonation joomdonation - close - 13 Nov 2022

Add a Comment

Login with GitHub to post a comment