I have a text field which displays only if one specific value is chosen from a checkboxes field.

When I use the 'Hide the dependent if the dependency is not triggered' option for the view settings the text field never displays, even if the chosen checkbox was ticked.

I have also done this with radio buttons and it works correctly so it seems to be a checkboxes thing (maybe something to do with being able to check multiple boxes?).

Comments

euginewm’s picture

Title: 'Hide the dependent if the dependency is not triggered' doesn't work with checkboxes » To solve your problem, please use conditional "Checked" or "Unchecked"
Component: Code » User interface
Category: bug » support

Hide the dependent if the dependency is not triggered' doesn't work with checkboxes

rooby’s picture

Title: To solve your problem, please use conditional "Checked" or "Unchecked" » 'Hide the dependent if the dependency is not triggered' doesn't work with checkboxes
Component: User interface » Code
Category: support » bug

Still a bug report if it doesn't work.

If it is not something that can be fixed then it can remain a bug report and then be marked 'closed (works as designed)' or 'closed (won't fix)'.

Otherwise, maybe it doesn't work now but could be fixed.
And if it can't be fixed it needs to be documented that it doesn't work.

aaronbauman’s picture

FWIW: i achieved support by using "has value" operator.
For my case, I needed a simple "select/other text" pattern (similar to select_or_other or explainfield module).

I used 2 rules:
dependent is required if dependee has value "Other"
dependent is hidden if dependee has none of the values "Other"

I'm not sure how this will work for you if, e.g. you have a dependent that should be shown/hidden based on multiple possible values.

monstrfolk’s picture

Issue summary: View changes

I can not get this to work as suggested in #4. Anyone else have luck making this work?

dqd’s picture

Title: 'Hide the dependent if the dependency is not triggered' doesn't work with checkboxes » Hide the dependent if the dependency is not triggered with checkboxes
Category: Bug report » Support request
Status: Active » Fixed

solution in #3 is correct and the proper set up to achieve this.

dqd’s picture

Status: Fixed » Closed (fixed)

Apart from that: Thanks for the report and all the efforts in here. But due to inactivity in this issue for some years and because of the upcoming EOL of Drupal 7, I will close this issue on the way by cleaning up the issue queue.

Feel free to re-open as "Needs review" if you found a solution or have a patch to be reported to help others on this outdated version.

If you think this issue or missing feature should be addressed in a newer Drupal core 8 and above compatible version of this project, then please file a new issue to the latest dev.