Skip to main content
2 of 3
Improve answer
d70rr3s
  • 949
  • 4
  • 14

Your approach is right but you have the wrong syntax.

$form['input']['adresse_home'] = [
  '#type' => 'textfield',
  '#title' => 'Adresse',
  '#required' => false,
  '#states' => [
    'visible' => [
      ':input[name="field_select_shipping[home]"]' => ['checked' => 'true'],
     // Omitted the rest.
  ],
];

UPDATE As commented here you need to set the name properly which already includes the value.

An excelent article about Form States API, thought is Drupal 7 is totally valid.

d70rr3s
  • 949
  • 4
  • 14