Skip to main content
Drupal API
User account menu
  • Log in

Breadcrumb

  1. Drupal Core 11.1.x
  2. ChoiceFormField.php

function ChoiceFormField::isDisabled

Check if the current selected option is disabled.

Overrides FormField::isDisabled

File

vendor/symfony/dom-crawler/Field/ChoiceFormField.php, line 46

Class

ChoiceFormField
ChoiceFormField represents a choice form field.

Namespace

Symfony\Component\DomCrawler\Field

Code

public function isDisabled() : bool {
    if (parent::isDisabled() && 'select' === $this->type) {
        return true;
    }
    foreach ($this->options as $option) {
        if ($option['value'] == $this->value && $option['disabled']) {
            return true;
        }
    }
    return false;
}
RSS feed
Powered by Drupal