public function WebformUiElementTypeFormBase::submitAjaxForm in Webform 8.5
Same name and namespace in other branches
- 6.x modules/webform_ui/src/Form/WebformUiElementTypeFormBase.php \Drupal\webform_ui\Form\WebformUiElementTypeFormBase::submitAjaxForm()
Submit form #ajax callback.
Parameters
array $form: An associative array containing the structure of the form.
\Drupal\Core\Form\FormStateInterface $form_state: The current state of the form.
Return value
\Drupal\Core\Ajax\AjaxResponse An Ajax response that display validation error messages or redirects to a URL
Overrides WebformAjaxFormTrait::submitAjaxForm
File
- modules/
webform_ui/ src/ Form/ WebformUiElementTypeFormBase.php, line 185
Class
- WebformUiElementTypeFormBase
- Provides a abstract element type webform for a webform element.
Namespace
Drupal\webform_ui\FormCode
public function submitAjaxForm(array &$form, FormStateInterface $form_state) {
// Remove #id from wrapper so that the form is still wrapped in a <div>
// and triggerable.
// @see js/webform.element.details.toggle.js
$form['#prefix'] = '<div>';
$response = new AjaxResponse();
$response
->addCommand(new HtmlCommand('#webform-ui-element-type-ajax-wrapper', $form));
return $response;
}