Support » Plugin: Contact Form 7 - Conditional Fields » AND/OR statement

  • Resolved orodruim

    (@orodruim)


    Hello.
    It is possible to configure the plugin to make some similar like AND/OR statements?
    I mean:
    I have a list of countries, and I want to show postal code only for 3 of them. The others must show the full address (, postal code, province/state, city…). Using the following code:

    if [pais] not equals "ES" then show [paisSinCP]
    if [pais] not equals "DE" then show [paisSinCP]
    if [pais] not equals "IT" then show [paisSinCP]

    It always shows the [paisSinCP] group, regardless of the chosen country. [paisSinCP] groups the full address.
    What I would need to do is:
    if [pais] not equals "IT" OR "DE" OR "ES" then show [paisSinCP] or
    if [pais] equals "IT" OR "DE" OR "ES" then hide [paisSinCP]

    I hope I have explain clearly.

    Thanks in advance.

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

    (@jules-colle)

    Hey,

    The next update will have AND rules. It’s a pretty big one. I will push my changes to the development version first, so adventurous people can test run it for a bit.

    Once it’s ready, I will update the plugin with a notice that the dev-version can be downloaded at your own risk. Keep an eye out for that one πŸ˜‰

    If you can’t wait. there is a work-around for AND rules in the FAQ. Please check it out.

    Thanks a lot Jules.
    You’re great!

    If you can’t wait. there is a work-around for AND rules in the FAQ. Please check it out.

    It doen’t work for me, because I would need

    if [a] not equals "1" then show [x-1]
    if [a] not equals "2" then show [x-1]

    Anyway, thanks. I will wait until the update.

    Plugin Author Jules Colle

    (@jules-colle)

    you can make it work with nested groups. check the FAQ.

    In the example you give instead of

    [group paisSinCP] .. [/group]

    you would need

    [group paisSinCP-1][group paisSinCP-2][group paisSinCP-3] .. [/group][/group][/group]

    with these conditions:

    if [pais] not equals "ES" then show [paisSinCP-1]
    if [pais] not equals "DE" then show [paisSinCP-2]
    if [pais] not equals "IT" then show [paisSinCP-3]

    Anyway. It’s not gonna look nice. If you can, wait for the update.

    • This reply was modified 1 year, 4 months ago by  Jules Colle.
    • This reply was modified 1 year, 4 months ago by  Jules Colle.

    Thanks a lot Jules. I have made this by now.

    You’re great again!

    Plugin Author Jules Colle

    (@jules-colle)

    Sure no problem. please consider leaving a review if you enjoy using the plugin πŸ˜‰

Viewing 6 replies - 1 through 6 (of 6 total)
  • The topic ‘AND/OR statement’ is closed to new replies.