Skip to main content
1 of 3
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"][value="home"]' => ['checked' => 'true'],
     // Omitted the rest.
  ],
];

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

d70rr3s
  • 949
  • 4
  • 14