You are here

public function YamlFormTemplatesSubmissionPreviewForm::validateForm in YAML Form 8

Button-level validation handlers are highly discouraged for entity forms, as they will prevent entity validation from running. If the entity is going to be saved during the form submission, this method should be manually invoked from the button-level validation handler, otherwise an exception will be thrown.

Overrides YamlFormSubmissionForm::validateForm

File

modules/yamlform_templates/src/YamlFormTemplatesSubmissionPreviewForm.php, line 61

Class

YamlFormTemplatesSubmissionPreviewForm
Preview form submission form.

Namespace

Drupal\yamlform_templates

Code

public function validateForm(array &$form, FormStateInterface $form_state) {
  if ($this
    ->isModalDialog()) {
    $form_state
      ->clearErrors();
  }
  else {
    parent::validateForm($form, $form_state);
  }
}