You are here

public function FlexsliderForm::validateThumbnailOptions in Flex Slider 8.2

Validate thumbnail option values.

Empties the value of the thumbnail caption option when the paging control is not set to thumbnails.

Parameters

array $element: The element to validate.

\Drupal\Core\Form\FormStateInterface $form_state: The form state.

File

src/Form/FlexsliderForm.php, line 490

Class

FlexsliderForm
Class FlexsliderForm.

Namespace

Drupal\flexslider\Form

Code

public function validateThumbnailOptions(array &$element, FormStateInterface $form_state) {
  if ($form_state
    ->getValue('controlNav') !== 'thumbnails' && $element['#value']) {
    $form_state
      ->setValueForElement($element, '');
  }
}