You are here

public function FancyFileDeleteManual::validateForm in Fancy File Delete 8

Same name and namespace in other branches
  1. 2.0.x src/Form/FancyFileDeleteManual.php \Drupal\fancy_file_delete\Form\FancyFileDeleteManual::validateForm()

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/FancyFileDeleteManual.php, line 71

Class

FancyFileDeleteManual

Namespace

Drupal\fancy_file_delete\Form

Code

public function validateForm(array &$form, \Drupal\Core\Form\FormStateInterface $form_state) {

  // Required doesn't work well with states it seemz.
  if (!$form_state
    ->getValue([
    'delete_textarea',
  ])) {
    $form_state
      ->setErrorByName('delete_textarea', t('You can not leave this blank, what are you thinking?'));
  }
}