You are here

public function JqueryCarousel::validateOptionsForm in jQuery carousel 8

Validate the options form.

Overrides StylePluginBase::validateOptionsForm

File

src/Plugin/views/style/JqueryCarousel.php, line 61

Class

JqueryCarousel
Style plugin to render each item in a grid cell.

Namespace

Drupal\jquery_carousel\Plugin\views\style

Code

public function validateOptionsForm(&$form, FormStateInterface $form_state) {
  $selector = $form_state
    ->getValue([
    'style_options',
    'selector',
  ]);
  $error = _jquery_carousel_config_validate($selector);
  if ($error) {
    $form_state
      ->setErrorByName('selector', t("Selector should not contain any special characters or spaces. Only special character allowed is '-'"));
  }
}