How can I uncheck a checkbox programmatically in Drupal 8. I need this in an ajax call, when an option is selected, a checkbox must be unchecked
After a lot of trial and error, I found out:
Imagine a checkbox with name 'Coffee' has one option: ['Y' => 'I want an espresso'].
To uncheck this selection, enter: $form['Coffee']['Y'][#checked]=false