Support for Drupal 7 is ending on 5 January 2025—it’s time to migrate to Drupal 10! Learn about the many benefits of Drupal 10 and find migration tools in our resource center.
I am having an issue that no matter how I set up my conditionals, all the fields are shown. I just uninstalled Webform Conditionals module after updating to webform-7.x-4.7. Then after reading this post https://www.drupal.org/node/2475469 updated to webform-7.x-4.x-dev (2015-Apr-26). I'm not seeing any difference. All the fields are shown. I am attaching a screenshot of my conditional rules and a test form is here: http://everettkelley.com/forms/test-form
I am not seeing any javascript errors on this as Dan Chadwick mentioned looking for.
Thanks for any help!
Comment | File | Size | Author |
---|---|---|---|
Screen Shot 2015-04-27 at 4.28.55 PM.png | 26.48 KB | LaurenW |
Comments
Comment #1
LaurenW CreditAttribution: LaurenW commentedComment #2
DanChadwick CreditAttribution: DanChadwick commentedI was in the midst of debugging your site when it went off-line.
You have a javascript error:
$triggerElement is null, meaning that a change event was found on an element which was not within an element with the 'webform-component' class. I didn't get far enough to see what was going on, but I'm suspecting a theme issue -- perhaps not all the required webform classes are present.
If you would like further help, please get the site back up. Also please disable CSS and JS aggregation and compression.
Comment #3
DanChadwick CreditAttribution: DanChadwick commentedWhatever module you are using to make the column 2 is messing up the classes that webform needs.
For example, on page:
http://everettkelley.com/discover-opportunity/submit-resume
The "General submission or specific position" question is a div:
There should be a webform-component--FORM_KEY class and instead there is a webform-component-column-2--FORM_KEY id.
By contrast, here's a working example:
Notice a) no id and b) the class webform-component--select. The form key for this component happens to be "my_select".
EDIT: Corrected some id/class confusion.
Comment #4
LaurenW CreditAttribution: LaurenW commentedBut my test form (http://everettkelley.com/forms/test-form) does not use columns and still does not work. I am not aware that I did anything to change the classes or IDs that webform puts on the divs around the field. The columns I am using in Submit Resume are just fieldsets which I do have a few extra classes on, but these are not affecting the classes on the field divs, only the field sets. This is the div around my 'choose options' select field:
<div class="form-item webform-component webform-component-radios" id="webform-component-choose-options">
Not sure how I would go about changing that ID to a class.
Thanks for your help.
Comment #5
DanChadwick CreditAttribution: DanChadwick commentedSome module or theme is doing it. That ID should be a CLASS and also you are missing a dash after webform-component. There should be two before the FORMKEY.
Comment #6
LaurenW CreditAttribution: LaurenW commentedDo you have any idea where I would edit the class structure on the fields to correct it or what module might be causing it? I was able to see the conditional working by editing the classes in the browser code inspector.
Comment #7
LaurenW CreditAttribution: LaurenW commentedI tried to work around the problem by putting a custom class on the field, however I am having an issue there. I can successfully add classes to fieldsets and class to the field inputs, but where I need to add the correct class (webform-component--FORMKEY) is "Wrapper CSS Class" on the field. And no matter what I put in "Wrapper CSS Class" on any field, it does not render on the page.
http://everettkelley.com/forms/testing-form
Comment #8
DanChadwick CreditAttribution: DanChadwick commentedSet your theme to Bartik. Problem gone? Then it's your theme. Go shoot your designer. Twice for good measure.
Problem still there? It's some other module. Start disabling other modules, starting with things that might mess with markup. When you figure out which one, file a indignant issue in its queue.
:)
It can't be THAT hard to figure out which module is butchering the HTML.
Comment #10
commonpike CreditAttribution: commonpike commentedOne of the things that might be 'butchering' your html is a civicrm webform payment form.
Its not really 'butchering' things and I wouldnt fix it there. A simple ' if ($triggerElement.size()) {' around the code block fixes it and is not all that ugly. If the event wasn't fired by a webform component, just ignore it.