In the Webform Conditional module when it was separate module, I was able to create a select component and have conditions using "Is one of" and "is not one of". Now the only options are "is" and "is not" which only allows 1 selection. I still can accomplish what I need but my conditions are ridiculously long.

e.g.

Condition 1: If Canada then show fieldset: Canada Address.
Condition 2: If US then show fieldset: US Address.
Condition 3: If Country1 show fieldset: Other Address or
if Country2 show fieldset: Other Address or
if Country3 show fieldset: Other Address or
...
....
if Country100 show fieldset: Other Address.

Am I going about this the right way? Here's another example of what I'm trying to do. http://d6-support.yale.edu/books/drupal-how-guide/creating-conditional-f...

Support from Acquia helps fund testing for Drupal Acquia logo

Comments

quicksketch’s picture

Why not set something like this up:

Condition 1: If Canada then show fieldset: Canada Address.
Condition 2: If US then show fieldset: US Address.
Condition 3:
If Canada then hide fieldset Other Address OR
If US then hide fieldset Other Address

Then "Other Address" will be shown if the select list is not Canada or US.

lampson’s picture

I gave it a go but no dice. The "Other Address" is shown when I load the webform since no country has been selected yet. I think there should be a condition for checking if the "Select Option" is still on "-Select-".

quicksketch’s picture

I think there should be a condition for checking if the "Select Option" is still on "-Select-".

This already exists. It's the "is empty" option. e.g. "If Country is empty then X".

lampson’s picture

I downloaded the latest 7.x-4.x-dev and I see the "is empty" and "is not empty". Works as expected, thank you!

quicksketch’s picture

Status: Active » Fixed

Super, thanks for testing it out!

Status: Fixed » Closed (fixed)

Automatically closed - issue fixed for 2 weeks with no activity.

ñull’s picture

Status: Closed (fixed) » Active

"Is empty" solution is off topic and does not fix it for me. Therefore reactivating to go back to the original issue.

I need to conditionally show some fields when for instance it is an African country. So the condition is on a large list and I don't want to add separate conditions for each country. So please restore "is (not) one of" functionality

gamaliz’s picture

I am having the same issue after upgrading to the latest webform. before fields which had a condition attached to them will not show unless the condition was selected. Now those fields are shown by default when the page loads. I need those fields hidden as with the previous version of webform.

gamaliz’s picture

FileSize
14.45 KB
24.48 KB
25.27 KB
38.38 KB

I went back until i found the version that worked. webform-7.x-4.4, any version after that one will show the fields by default.

images bellow:
working
risk_cond are my conditions (wich are working fine with webform-7.x-4.4 (and any previous version).
risk_expected is what I expect to see when I go to the webform. if the value is empty
risk_form is what expect to happen when i click on "Yes".

Now:
risk_wrong_select is what happens when I install webform-7.x-4.5 and above. you can see that those fields are shown by default. I can hide and show them by clicking no/yes perfectibility, but those two fields (if risk factor YES, Age at first risk factor) should remain hidden until Yes is clicked

I created this site with webform 7.x.3... and upgraded to branch 4 (which was a pain as it duplicated all those conditions back then and I had to edit the database to delete all the duplicates. If I now have to create a condition for every field I am hiding 'if empty) I am going to have to create over 100 conditions per form on that site. I can't see why if so far it has worked in a certain way, now it has to change the behavior.

Thanks for the great module :)

gamaliz’s picture

I opened a new issue with this problem. I was trying to delete this post but I can't find how to do it. :/

DanChadwick’s picture

Status: Active » Closed (fixed)

@null -- Your issue is unrelated to the is empty / not empty. In the latest -dev, you can use greater than, less than type conditions on the select list, and they operated on the list in the order of the options. If you put the options together you can achieve what you want. If you are still having trouble, open a new issue with lots more detail what you are trying to do.