Skip to content
Snippets Groups Projects

Issue #3400501: Moving the 'actions' form element of a signup form into a...

1 file
+ 3
2
Compare changes
  • Side-by-side
  • Inline
@@ -408,10 +408,11 @@ class MailchimpSignupPageForm extends FormBase {
* A ajax response.
*/
public function ajaxSubmit(array $form, FormStateInterface $form_state) {
$triggering_element = $form_state->getTriggeringElement();
$response = new AjaxResponse();
$response_wrapper_id = '#' . $form['actions']['submit']['#ajax']['response_wrapper'];
$response_wrapper_id = '#' . $triggering_element['#ajax']['response_wrapper'];
// Simply return any status messages as a content the the response wrapper.
// Simply return any status messages as a content the response wrapper.
$status_messages = ['#type' => 'status_messages'];
$content = \Drupal::service('renderer')->renderRoot($status_messages);
$response->addCommand(new HtmlCommand($response_wrapper_id, $content));
Loading