Is there perhaps a way to create a condition for an element not to be shown? So instead of “show A if B” you have “do not show A if B”. That way, I could at least invoke DeMorgan’s Laws to create the AND equivalent of the OR conditions I need to create. But it isn’t at all obvious how, or even if, your plugin can be used to either create false boolean conditions or OR statements. I kind of need at least one of those two things to move forward.
It’s pretty simple. But I admit that it’s not clear from the docs. I’ll need to add a page to my website to explain how you can create different kinds of conditions.
Form:
[checkbox check "option1" "option2"]
[group any-group]Any option is selected[/group]
If you want to show the any-group if check=option1 OR check=option2, you simply add these 2 conditions:
show [any-group] if [check] equals "option1"
show [any-group] if [check] equals "option2"
-
This reply was modified 5 years, 6 months ago by
Jules Colle.
First attempt at a page with some better explanation: https://conditional-fields-cf7.bdwm.be/and-or-not/ (will extend this with some better examples in the future, but want to have the link here before this thread gets locked)
Oh wow, actually now that you point out that OR method, it’s striking me as kind of obvious. Maybe I should have thought to try that, but I obviously didn’t so thank you for the response, which was also quick I might add. This solves my issue. And also your and-or-not page is good and clear. Have you considered maybe adding an OR button in addition to the AND button? And for text mode a syntax like the following?
“show [w] if [x] equals y
or [x] equals z”
Obviously since OR can be done the way you described, and you now have it documented, it’s not a critical feature. I am using your solution just fine and am okay with it, but if you have an OR button or actual OR syntax, I could accomplish the same thing while declaring fewer rules and with a little bit less tedium, and it would also just be following the same convention as the AND method (nice for consistency and keeping things intuitive). Obviously not a high priority, but just a thought.
Anyway, thank you for your plugin and your support. Makes life easier
I wish I had asked this question months ago! There are work-arounds, but they involve testing sequentially for many cases.