This module doesn't work reliably when using webforms displayed as blocks. When a webform is displayed in a block, the IDs of the generated elements are modified slightly (to prevent the forms in the block and node from clashing if it's displayed on the same page). The approach this module takes to calculating IDs of form elements ignores this and, therefore, the IDs are incorrect. For some reason the IDs are *not* modified when the form is submitted with validation errors, and so the conditional field functionality works.
Inserting a `dsm()` into `webform_conditional_form_alter()` shows that the `#id` is correct. I'd suggest removing the call to `_webform_conditional_get_css_id()` -- which *calculates* an expected ID -- and just using the ID from the form which is actually being processed.
Comments
Comment #1
ashtronaut commentedI am having the same issue when displaying conditional fields in a webform within a block. Is there a fix anywhere for this? Displaying a webform in a block is a pretty standard feature so I have updated the priority. I'm surprised this bug hasn't received more attention.
Comment #2
tedbowadding "blocks" tag so I connect to other issues
Comment #3
densolis commentedAll,
I am helping Ted with this module and will be talking with him tomorrow (8-30-12). I will bring this to his attention. Either Ted or I will follow up.
Dennis
Comment #4
tedbow@ashtronaut can you tell me if the patch/commit here fixes the issue for you? #1704682: multiple webforms on one page do not trigger conditionals (includes working patch)