You are here

public function WebformTemplatesSubmissionPreviewForm::validateForm in Webform 6.x

Same name and namespace in other branches
  1. 8.5 modules/webform_templates/src/WebformTemplatesSubmissionPreviewForm.php \Drupal\webform_templates\WebformTemplatesSubmissionPreviewForm::validateForm()

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 WebformSubmissionForm::validateForm

File

modules/webform_templates/src/WebformTemplatesSubmissionPreviewForm.php, line 59

Class

WebformTemplatesSubmissionPreviewForm
Preview webform submission webform.

Namespace

Drupal\webform_templates

Code

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