You are here

protected function WebformSubmissionForm::isAjax in Webform 8.5

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

Returns if webform is using Ajax.

Return value

bool TRUE if webform is using Ajax.

Overrides WebformDialogFormTrait::isAjax

4 calls to WebformSubmissionForm::isAjax()
WebformSubmissionForm::attachBehaviors in src/WebformSubmissionForm.php
Attach behaviors with libraries to the form.
WebformSubmissionForm::buildForm in src/WebformSubmissionForm.php
Form constructor.
WebformSubmissionForm::confirmForm in src/WebformSubmissionForm.php
Webform confirm(ation) handler.
WebformSubmissionForm::wizardSubmit in src/WebformSubmissionForm.php
Webform submission handler for the wizard submit action.

File

src/WebformSubmissionForm.php, line 3089

Class

WebformSubmissionForm
Provides a webform to collect and edit submissions.

Namespace

Drupal\webform

Code

protected function isAjax() {
  if ($this->operation === 'api') {
    return FALSE;
  }

  // Disable Ajax if the form has its #method set to 'get'.
  $elements = $this
    ->getWebform()
    ->getElementsInitialized();
  if (isset($elements['#method']) && $elements['#method'] === 'get') {
    return FALSE;
  }
  return $this
    ->getWebformSetting('ajax', FALSE);
}