You are here

public function ModalForm::validateForm in Editor Notes 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/ModalForm.php, line 207

Class

ModalForm
Implements the ModalForm form controller.

Namespace

Drupal\editor_note\Form

Code

public function validateForm(array &$form, FormStateInterface $form_state) {
  $input = $form_state
    ->getValue('editor_note');
  if (empty($input)) {
    $form_state
      ->setError($form['editor_note'], $this
      ->t('Note text is empty.'));
  }
}