If a conditional field is within a fieldset, set to collapsed, the initial hidden state isn't respected.

Presumably jquery cant find the field since its parent element is already hidden.

Would putting "display: none", at the theme level, on the appropriate wrapper fix this?
Or can we change the order in which the fieldsets and cf javascript is executed?

Thanks!

CommentFileSizeAuthor
#1 conditional_fields_js_357558.patch5.9 KBpeterpoe
Support from Acquia helps fund testing for Drupal Acquia logo

Comments

peterpoe’s picture

Status: Active » Needs review
FileSize
5.9 KB

This one was difficult: collapse.js toggles visibility of the content of a fieldset by adding and removing the 'collapsed' class that has a 'display: none' property attached to all contents. Since the field inside is already hidden by css, jQuery's hide() function didn't add a 'display: none' property to it. So I had to change it with a css('display', 'none') function.

Patch included. Note that the javascript has been reworked a bit to avoid duplication of code.

peterpoe’s picture

Status: Needs review » Fixed

Committed to dev.

Status: Fixed » Closed (fixed)

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

kenorb’s picture

This patch caused this issue: #373954: doesn't work with content_profile_registration.module on Registration form
I've made the patch, which revert some changes from this committed patch.