As I was testing showon in the frontend for custom fields, I noticed a strange behavior when using the negation of values (!) for the condition in the backend, when multiple values are selected.
When using a condition such as 'field!:value1', the field the condition is applied to should not show if 'field' has value1 or a combination of values, including value1.
Since a picture is worth a thousand words, here is the issue.
I have a checkbox custom field, which can have value1, value2 and value3.
I have created a custom field (icon picker), which will only show if value1 is NOT selected.
Now, I head to an article and try my settings.
If the checkbox has value1, the icon field won't show.
If the checkbox has value2, the icon field will show. All good until now.
Now, if the checkbox has values value1 AND value2, the icon field still shows, while it should not.
Happens in Joomla 4.3 but I suspect it may have been a long-lasting issue.
n/a
Labels |
Removed:
?
|
Labels |
Added:
No Code Attached Yet
|
My assumption is that when a condition is set to NOT EQUAL, if the field the condition is based on has multiple values including the value set in the NOT EQUAL' condition, then the field should not show.
The documentation only says (https://docs.joomla.org/Form_field#Showon):
You can also use value 'does not equal' as in showon="field1!:1".
The syntax to show the field "bar" only when "foo" is not equal to "1":
So it is just my assumption in how I think it should behave.
Labels |
Added:
bug
|
what makes you have that conclusion - I did not make the same conclusion from the docs or the various pull requests.
from my reading nowhere does it say anything about "where x IN y" only "where x EQUALS y" and "where x NOT EQUAKS y"