You are here

public function RecaptchaSettingsForm::validateForm in reCAPTCHA 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

lib/Drupal/recaptcha/Form/RecaptchaSettingsForm.php, line 103
Contains \Drupal\recaptcha\Form\RecaptchaSettingsForm.

Class

RecaptchaSettingsForm
Provides the reCAPTCHA administration settings.

Namespace

Drupal\recaptcha\Form

Code

public function validateForm(array &$form, array &$form_state) {
  $tabindex = $form_state['values']['recaptcha_tabindex'];
  if (!empty($tabindex) && !is_numeric($tabindex)) {
    form_set_error('recaptcha_tabindex', $form_state, $this
      ->t('The Tab Index must be an integer.'));
  }
  parent::validateForm($form, $form_state);
}