Imagine the following setup:

Field 1
- option A
- option B
- option C
Field 2
- option A
- option B
- option C
Field 3
- option A
- option B
- option C

Field 2 only appears if Field 1 gets option C and Field 3 only appears if Field 2 gets option C

if u then were to set Field 1 to C, Field 2 appears, set that to C and Field 3 appears. Now change Field 1 to A. Field 2 will disappear, but Field 3 will not

attached patch goes over dependencies recursively when hiding fields and is sort of merged with #750364: Don't pollute the global scope and use Drupal's APIs to add settings/behaviours

I'll try to post a patch without the namespacing stuff

Comments

seutje’s picture

note: I found an issue with var component = $('[name*="'+field_name_dependent+'"]');

when the login block is visible while this is run, under certain conditions u will get an error about the indexOf method due to the username field having name="name"

this only seems to occur with jQuery 1.2.6, so either updating or removing the login block from webform pages seems to be a working "solution"

Marat’s picture

I had not tried to put dependencies of dependencies options.

I applied the patch, it works fine with me. Thank you @seutje for the patch.

tedbow’s picture

seutje and/or Marat the module is much different now. Could someone confirm this is no longer an issue?

Marat’s picture

tedbow I reinstalled this module since you updated it and it works with me. This is no logner an issue for me. Thank you!

tedbow’s picture

Status: Needs review » Closed (fixed)

Marat, thanks for the update. I marking as fixed since issue is so old and the module has changed so much.

dsrikanth’s picture

Version: 6.x-1.x-dev » 6.x-1.0-beta1
Status: Closed (fixed) » Active

hi, I am not sure what changed between Jan 19 and now. I see the very same problem as the original in the latest beta.

tedbow’s picture

dsrikanth’s picture

Thanks for the quick reply.
I tried the demo at http://www.tedbow.com/content/drupal/webform-conditional-testing-depende...

Clicked 'C' from Field 1 --> Clicked 'C' from Field 2 --> Clicked 'A' from Field one and Field 3 gets hidden. However, Click on 'C' from Field 1 again --> You will see that Field 2 still has 'C' selected. I thought this value should be cleared when 'A' was selected in Field 1. Let me know if is otherwise.

Another thing, if you can make Field 2 'Checkbox' instead of 'Radio', I think you will be able to see the original issue.. :)

tedbow’s picture

I am longer clearing the values on the client-side. this happens on the server side.

here is example of with checkboxes. believe it works also: http://tedbow.com/content/testing-dependencies-checkbox

dsrikanth’s picture

The example you put up is working fine. I am not sure why my form is having this issue --> http://drupaldemo.econsultancyservices.com/?q=node/3

However, when I am creating new webform, I don't see this issue. The form above is was created by very first dev version of Webform_Conditional and recently upgraded to the latest beta....

tedbow’s picture

Status: Active » Closed (fixed)

dsrikanth,
I am going to mark this as fixed b/c it is working with forms created with the beta version. Although I tried not to break things going forward with the dev version, they are "development" versions so there is no guarantee.