PLEASE NOTE: These forums are no longer utilized and are provided as an archive for informational purposes only. All support issues will be handled via email using our support ticket system. For more detailed information on this change, please see this blog post.

Bug : Conditional Logic is based on Value rather than Label

  1. Hi all,

    I've come across a wee little bug when trying to set up a form.

    ----------------------
    TL;DR : I think there is a bug, in that Drop Down Lists (with Values) are uniquely identified based on their value rather than their label. However, when there are multiple duplicate values in a values list, subsequent fields that are set to show conditionally based on that drop down field might show at the incorrect conditional situations because it shares its drop down list value with the selected drop down option.

    ------------------------

    We ask for payment method (Drop down) and we have a label and a value ...
    Label - Value
    Paypal - Paypal
    Bank Transfer - NIL
    Cheque - NIL
    Cash (Paid) - Cash
    Cash (Will Pay) - NIL

    The logic above is : If we definitely have their money, then put the payment method down, otherwise we don't care what they said, their payment is 'NIL'. (NIL is used for our own database uses - It's parsed to mean "").

    We then have several HTML fields below. Eg. If they have chosen Cheque, there is a HTML field which provides them with our mailing address. If they choose Bank Transfer, a different HTML field appears. We use conditional logic to show these fields, however this is where the bug appears.

    It seems that GF is storing the Drop Down list by its values, rather than its labels (Not sure whether that is by design or not). However, the effect for my form is that when I set the conditional logic to show only when the user has chosen the payment method of "Bank Transfer", when I 'close' that field in the 'form editor' and re-edit it, it has automatically defaulted to conditionally show only on the condition of "Cash (Will Pay)". I believe this is because it also shares the value "NIL".

    Indeed, saving and viewing the form shows multiple HTML fields for multiple user payment selections... This is definitely wrong, as they should be, at the very least, only appearing for a single payment choice, not for multiple.

    Checks
    - Downloaded and upgraded to the latest version of GF 1.6.8.1
    - Renaming the Values of NIL to NIL1, NIL2, NIL3 solved the problem.
    - Running WP3.4

    Posted 12 years ago on Sunday October 14, 2012 | Permalink
  2. It was a design decision to base the conditional logic rules on the values not the labels. The values need to be unique for conditional logic to work.

    Posted 12 years ago on Monday October 15, 2012 | Permalink
  3. Okay. Well, to any future people who may encounter this problem, my solution, and indeed, the solution which is necessary for conditional logic to work, is to make each of the values unique. i.e. I renamed each of NIL to NIL1, NIL2, NIL3.

    For me, I have been able to work around it.

    Posted 12 years ago on Tuesday October 16, 2012 | Permalink
  4. Thank you for the update.

    Posted 12 years ago on Tuesday October 16, 2012 | Permalink

This topic has been resolved and has been closed to new replies.