Last active
November 8, 2022 12:44
-
-
Save Seorusus/400cc5ef5be1197ca2d20fc2fa2fe10d to your computer and use it in GitHub Desktop.
Drupal 9 Валидация поля select
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
case 'organism_cta': | |
switch ($entityType) { | |
case 'overview': | |
// Adds field_align validation. | |
$element['subform']['field_media']['widget']['#required'] = TRUE; | |
$element["subform"]["field_align"]['#attributes']['name'] = 'field_align'; | |
$element["subform"]["field_media"]['#states'] = [ | |
'invisible' => [ | |
':input[name="field_call_to_action[0][subform][field_align]"]' => [ | |
'value' => 'center', | |
], | |
], | |
]; | |
} | |
break; |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment