If you have a fieldgroup which is collapsed by default that contains an explainfield, expanding that fieldgroup will always display the optional explain field regardless of what key is selected.

The problem is that hide() is trying to be used on an element which is already not being displayed. To get around this you can replace uses of .hide() with .css('display', 'none') in places where the form is being first evaluated on $(document).ready and the explain field may be in a collapsed fieldgroup.

Comments

snufkin’s picture

Version: 5.x-1.0 » 5.x-1.x-dev

hmm i never tried in a fieldgroup, i'll see what i can do. I think that the JS part of the module at the moment is rather crude, i'll rewrite it and test with fieldsets. thanks for the hint!

zbricoleur’s picture

Thank you for the elegant solution, cYu, I've been banging my head against this problem all day.