You are here

public function YamlFormResultsCustomForm::validateForm in YAML Form 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/YamlFormResultsCustomForm.php, line 267

Class

YamlFormResultsCustomForm
Form for form results custom(ize) form.

Namespace

Drupal\yamlform\Form

Code

public function validateForm(array &$form, FormStateInterface $form_state) {
  $columns = $form_state
    ->getValue('columns');
  if (empty($columns)) {
    $form_state
      ->setErrorByName('columns', $this
      ->t('At least once column is required'));
  }
}