You are here

public function SettingsForm::validateForm in Simple Responsive Table 8

Form validation handler.

Parameters

array $form: An associative array containing the structure of the form.

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

Overrides FormBase::validateForm

File

src/Form/SettingsForm.php, line 88

Class

SettingsForm
Class SettingsForm.

Namespace

Drupal\simple_responsive_table\Form

Code

public function validateForm(array &$form, FormStateInterface $form_state) {
  if (!is_numeric($form_state
    ->getValue('max_width'))) {
    $form_state
      ->setErrorByName('max_width', $this
      ->t('Max width should be number.'));
  }
}