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