• Resolved Stephen

    (@ssgconline)


    Hi,

    I am wondering if it is possible to create a logical if/then calculation?

    I have a calculation field with the following, where select-1 & select-2 are numbers between 0 to 3.
    {select-1}+{select-2}

    If {select-1}+{select-2} is greater than 3, then I want to display a message like “Max 3 allowed”.

    Is this possible?

    Thanks,
    S

Viewing 4 replies - 1 through 4 (of 4 total)
  • Plugin Support Kris – WPMU DEV Support

    (@wpmudevsupport13)

    Hi @ssgconline

    I hope you are doing good today.

    This should be possible:

    1. For select-1 & select-2 enable calculation in calculation tab and set up correct values like 0, 1, 2, 3

    2. For main Calculations field set up {select-1}+{select-2}

    3. Create an HTML field with the custom text “Max 3 allowed”. For that HTML field in Visibility rules set up rules as:
    – SHOW
    – ALL
    – field: Calculation
    – Condition: Is great / Value 3

    4. For Submit button in Visibility rules set up rules as:
    – SHOW
    – ANY

    – and create 2 rules:
    — field: Calculation
    — Condition: Is less / Value 3

    — field: Calculation
    — Condition: Is / Value 3

    Thanks to that your additional message will be visible only when the value will be 4 or more and at the same time Submit button will show up when the value will be 3 or less.

    Kind Regards,
    Kris

    Thread Starter Stephen

    (@ssgconline)

    Many thanks, Kris – that has worked for me.

    Is there any way I can reduce the vertical gap between fields so they are more closely grouped together?

    Plugin Support Kris – WPMU DEV Support

    (@wpmudevsupport13)

    Hi @ssgconline

    Could you go to the Appearance tab in your form and navigate to the Form Container section? You will find there Spacing part, which can be switched to “Compact” and it reduces those spaces by default.

    Kind Regards,
    Kris

    Thread Starter Stephen

    (@ssgconline)

    Thanks, Kris – that has worked for me

Viewing 4 replies - 1 through 4 (of 4 total)
  • The topic ‘Logical (if/then) Calculation’ is closed to new replies.