How to uncheck other checkboxes if one specific is gets checked

by Thomas0878   Last Updated January 11, 2018 12:07 PM

I have a field of type list using checkboxes: 1|green 2|blue 3|black ... 0|no preference

Multiple items can be chossen. However if the last item gets checked (no preference) all other ones should be unchecked and vice versa. Default value is 'no preference'. If for example 'green' gets checked, 'no preference' should be unchecked. But it should be possible to check multiple other ones like 'green' and 'blue'.

Can this be achieved using the #states system? How can this be achieved?

Tags : 8 fields

Related Questions

How would I create conditional fields on install?

Updated October 13, 2016 09:03 AM

D8 - edit fields on display node

Updated March 05, 2018 22:07 PM