• Resolved supadigital

    (@supadigital)


    Hi

    Does this plugin (or the pro version) have the ability to HIDE a field based on a matching condition.

    I have a form with questions related to the user’s age, income, employment status etc (for insurance products) and based on their selections for the aforementioned questions, I need to HIDE relevant insurance checkbox options at the END of the form.

    So if AGE = under 18: I need to hide all checkbox options.
    OR if Income = Under 3500 I need to HIDE certain checkbox options.

    However if the user does the following:

    If age = Under 18 and Income = MORE THAN 3500 then all options must still HIDE.

    Basically I need to HIDE certain checkboxes If certain conditions are met via:

    HIDE FIELD if:

    – VALUE_A = X
    OR VALUE_B = Y
    OR VALUE_C = Z

    So if ANY of the above are true, the field must be HIDDEN. Even if A and C are false, but B = TRUE, then the field must still be hidden.

    Is this possible?

    Thanks

Viewing 6 replies - 1 through 6 (of 6 total)
  • Plugin Author Jules Colle

    (@jules-colle)

    All fields are hidden by default, the conditions define when a group will be shown, so

    HIDE GROUP if:
    VALUE_A = X
    OR VALUE_B = Y
    OR VALUE_C = Z

    can be written like this:

    SHOW GROUP if:
    VALUE_A not equals X
    AND VALUE_B not equals Y
    AND VALUE_C not equals Z

    It will have the same effect.

    Thread Starter supadigital

    (@supadigital)

    Hi Jules

    Thanks for the feedback once again, much appreciated.

    The problem with the above is the AND statements. My understanding and what I previously experienced when attempting the above, is that if ANY ONE of the conditions you have stated above is NOT TRUE/FALSE, then the group remains hidden.

    What I need to do is:

    SHOW GROUP if:

    VALUE_A not equals X
    OR VALUE_B not equals Y
    OR VALUE C not equals Z

    The plugin does not seem to have an “OR” option, and if I enter these as three separate statements, then the final state of the GROUP is SHOWN if either of the CONDITIONS is TRUE, which is not what needs to happen, because if ANY of the conditions is FALSE then the field must REMAIN HIDDEN. I need to SHOW/HIDE GROUP if ANY condition is TRUE/FALSE.

    I hope this is clear. Please let me know if what I am trying to achieve is possible with this plugin and if so, how I would enter it.

    Thanks again ??

    Plugin Author Jules Colle

    (@jules-colle)

    the or condition is assumed whenever you don’t use the and conditions. https://conditional-fields-cf7.bdwm.be/and-or-not/

    Thread Starter supadigital

    (@supadigital)

    Hi Jules

    I understand how the form works I think. The issue I am having is that I have more than 2 OR statements that apply to a GROUP.

    Here is a link to the test form in question as an example:

    https://winmoney.co.za/all-vouchers/test-page-2/

    The form has 4 separate dropdown lists whose VALUES decide whether or not FUNERAL INSURANCE is displayed or not. I have the following conditions setup:

    show [funeralc] if [your-age] not equals “Under 18”
    show [funeralc] if [sa-citizen] not equals “No, I am not South African”
    show [funeralc] if [are-you-employed] not equals “No, I do not have a job”
    show [funeralc] if [your-income] not equals “Less than R3 500”

    The problem is, if ANY of the above conditions isn’t met, then funeralc must not be displayed. EG:

    if your-age EQUALS “Under 18” then the funeralc must remain hidden regardless of whether or not any of the other conditions are true or not.

    EG 2:

    IF are-you-employed EQUALS “No, I do not have a job”, then funeralc must stay hidden regardless of the other selections.

    How do I achieve this?

    I Hope this clarifies my requirements.

    Really appreciate your time on this. Thanks

    Plugin Author Jules Colle

    (@jules-colle)

    have you tried using the AND button? it’s right next to each condition. You should create the rules just like in my first post and it will work.

    Thread Starter supadigital

    (@supadigital)

    Hi Jules

    I am in disbelief of my stupidity in this regard. So sorry – your logic makes sense and it works (well it should – i haven’t done it just yet) and I cannot BELIEVE I couldn’t figure this logic out. Very dumb of me.

    I should be fine from hereon in. THANK YOU SO MUCH! I really appreciate the assistance.

Viewing 6 replies - 1 through 6 (of 6 total)
  • The topic ‘Can I HIDE a field based on conditions’ is closed to new replies.