Reviewed & tested by the community
Project:
Field Conditional States
Version:
7.x-2.x-dev
Component:
Code
Priority:
Major
Category:
Bug report
Assigned:
Unassigned
Reporter:
Created:
27 Nov 2014 at 08:18 UTC
Updated:
29 Sep 2017 at 11:36 UTC
Jump to comment: Most recent, Most recent file
Comments
Comment #1
ryan.ryan commentedThis happens for me as well. And as they're separate settings that can be added in the UI without overwriting the other, it seems more appropriately categorized as a bug.
Comment #2
drupalove commentedEdit: Please ignore my comment as I was confused with another module.
When the condition is set to 'Value' and the form state is set to 'Required' in this case you will not get the Show/Hide option. Therefore field y will always be visible which I think is a normal behaviour. This module provides visibility settings via the Show/Hide effect option which is available only if you select visible or invisible.
It is possible to add Show/Hide effect when 'Required' is selected but I don't think the module was intended to do this.
You can achieve what you want by setting the form state of field x to 'Visible' and making field y required. Please correct me if I'm wrong.
Comment #3
kopeboyWhat if I have:
and I want:
Came here from Conditional Fields because they seem to support this, but the required/optional part doesn't work (at least on Commerce>CustomerProfile>Billing)
Comment #4
drupalove commented@kopeboy yours is a different issue. See #2222659: Add support for "Check boxes/radio buttons" widget.
Until that issue is resolved you can achieve what you want with the select list widget.
Comment #5
chrisrockwell commentedUpdating title to be more accurate.
_field_conditional_state_add_direct_statesdefines states that are added after visible/invisible are added. However,_field_conditional_state_build_states_arrayresets$element['#states'].The attached patch allows for existing states.
Comment #6
greenstick commentedThanks Chris! Patch worked for me and was sorely needed. (I should note I changed it manually here on Windows/WAMP since I don't have a patching utility handy so I can't attest to the .patch file so much as the code changes referenced therein.)
Anyway, totally did the trick.
Comment #7
welly commentedWorks for me too. Just tested. Nice patch, thank you.