• Resolved strangequark

    (@strangequark)


    Hi Jules,

    The conditional functionality your plugin brings to CF7 is much appreciated. I do have a question, though, as I’m working on a project involving the need for conditional fields in a form, and I’ve decided to go with CF7 with your plugin as a solution. I’m almost halfway into building my form when I have suddenly bumped into a case where I must allow any of four checkboxes within a group to show only if at least one of the other three are unchecked. This isn’t possible with multiple conditions using only the AND operator. I’m in need of OR, and so I checked out the features in the Pro version of your plugin to see if upgrading to Pro would introduce OR to the conditional fields functionality. From what I’ve read, I’ve seen nothing specific that states that OR is included, so I just thought I’d ask you personally. Can I use OR if I upgrade to Pro? If not, or if you’re unaware of any other workaround solution with CF7, I may have to ditch CF7 in favour of another solution.

    Cheers!

Viewing 5 replies - 1 through 5 (of 5 total)
  • Thread Starter strangequark

    (@strangequark)

    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.

    Plugin Author Jules Colle

    (@jules-colle)

    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 4 years, 1 month ago by Jules Colle.
    Plugin Author Jules Colle

    (@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)

    Thread Starter strangequark

    (@strangequark)

    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.

Viewing 5 replies - 1 through 5 (of 5 total)
  • The topic ‘No OR Logic Available?’ is closed to new replies.