Account created on 16 May 2011, over 13 years ago
  • Drupal Developer at MyplanetΒ  …
#

Recent comments

πŸ‡¨πŸ‡΄Colombia meickol

meickol β†’ made their first commit to this issue’s fork.

πŸ‡¨πŸ‡΄Colombia meickol

I am using #states for in a node edit form, with this code

$form["field_ad_image"]["widget"][0]['#states'] = [
      'visible' => [
        ':input[name="field_interstitial_ad[value]"]' => ['checked' => TRUE]
      ],
      'required' => [
        ':input[name="field_interstitial_ad[value]"]' => ['checked' => TRUE]
      ]
    ];

Using the patch #24 the field `field_ad_image` get visible if the `field_interstitial_ad` is checked, if not get hidden, but with the required is not working right because the field get the required mark but anyway you can save the form without upload any image.

Drupal/core 8.6.4 , PHP 7.2.5

Production build 0.71.5 2024