You are here

public static function WebformSubmissionForm::removeConfirmationModal in Webform 8.5

Same name and namespace in other branches
  1. 6.x src/WebformSubmissionForm.php \Drupal\webform\WebformSubmissionForm::removeConfirmationModal()

Hide confirmation modal during form validation.

This prevent duplicate modal dialog from appearing.

File

src/WebformSubmissionForm.php, line 2509

Class

WebformSubmissionForm
Provides a webform to collect and edit submissions.

Namespace

Drupal\webform

Code

public static function removeConfirmationModal(&$element, FormStateInterface $form_state, &$complete_form) {

  // Reset confirmation modal.
  $storage = $form_state
    ->getStorage();
  unset($storage['webform_confirmation_modal']);
  $form_state
    ->setStorage($storage);

  // Remove modal from form.
  unset($complete_form['webform_confirmation_modal']);
}