Support for Drupal 7 is ending on 5 January 2025—it’s time to migrate to Drupal 10! Learn about the many benefits of Drupal 10 and find migration tools in our resource center.
When you create a form with following field, if the state makes it invisible, the format selection stays visible.
It should also hide the format selection.
$form['foo'] = [
'#type' => 'text_format',
'#format' => 'plain_text',
'#editor' => true,
'#states' => array(
'visible' => array(
':input[name="bar"]' => array('checked' => TRUE'),
),
),
];
State visible:
State not visible:
Comment | File | Size | Author |
---|
Comments
Comment #2
StryKaizerComment #3
StryKaizerComment #6
sdstyles CreditAttribution: sdstyles at FFW commentedDuplicate of https://www.drupal.org/node/997826