Closed (duplicate)
Project:
Conditional Fields
Version:
7.x-3.x-dev
Component:
Javascript
Priority:
Normal
Category:
Feature request
Assigned:
Unassigned
Reporter:
Created:
30 Jan 2013 at 16:18 UTC
Updated:
12 Feb 2021 at 13:52 UTC
Jump to comment: Most recent, Most recent file
Comments
Comment #1
amogiz commentedSubscribe !
Comment #2
drupov commented+1 for that too. It would be really important to see it work.
Thanks!
Edit: or is it a duplicate of https://drupal.org/node/1161314 ?
Comment #3
vlooivlerke commentedThis is not a duplicate, the other issue is about fieldgroup and not fieldset
I want to hide an empty fieldset
Comment #4
chrislabeard commentedAnyone find a solution for this?
Comment #5
System Lord commentedI, too, would like to see this fixed.
Comment #6
GemQueen commentedMe too!
Comment #7
jacquelynfisher commentedSame here. Since fieldsets are now built into Drupal, it is important to be able to hide the fieldset, whether we make the fieldset itself conditional or if we hide the fieldset when "empty" (all fields within are conditionally hidden).
Comment #8
anrikun commentedPlease try this patch that hides fieldsets unless one of their fields is visible.
Comment #9
zekvyrin commentedGreat! It works as expected for me.
Comment #10
zekvyrin commentedWell, I guess I was too fast to answer..
This doesn't check recursively (for example it doesn't hide a group which has a "hidden" group which was hidden by this)
Comment #11
bobdekinder commentedPatch #8 works perfectly for me. https://www.drupal.org/node/1161314 would be a more cleaner solution, but for now this will do :)
Comment #12
wildfeed commentedPatch #8 is a BINGO. Spot on. Thank you anrikun!
Comment #13
tedstein commentedPatch works perfectly for the closest fieldset. However, if fieldsets are nested then the patch fails to reach the outer fieldsets.
This also breaks if there are nested fieldsets: The nested fieldsets do not reappear when the condition is triggered.
Comment #14
scotwith1tAny movement on this one? We regularly run into this and just opt to not bother putting things into a fieldset at all because of it...
Comment #15
knalstaaf commentedChanging status (see #13).
Comment #16
knalstaaf commentedOn second thought, maybe we should consider this as a duplicate of #1161314: Add basic Field Group support for ANDing conditions (as mentionned in #11).
Comment #17
anrikun commentedAll right, I've just posted a new version of my patch that should work with nested fieldsets there.
See #1161314: Add basic Field Group support for ANDing conditions
Comment #18
roflcopterDorrie commentedSince #1161314: Fieldgroup support is still not working correctly, I applied this patch and found that it wasn't working for me.
:visible was always returning true, even when the element had display:none.
So I updated it to look for display:none instead.
Comment #19
delacosta456 commentedthanks @anrikun and @roflcopterDorrie ...
@roflcopterDorrie your patch work correctly together with this patch https://www.drupal.org/node/2494385#comment-10708812 on my panopoly distribution 1.46
Comment #20
jo66 commentedAlready old topic but in my case I had to change this line
var $wrapper = $(e.target).closest('.fieldset-wrapper');to
var $wrapper = $(e.target).parents('.fieldset-wrapper');in @anrikun patch for it to work correctly (date with end date was not displaying inside my groupfield)
Hope it can helps someone
Comment #21
aram.gevorgyan commentedI changed last patch by checking if there are any visible children except fieldset description