Update element form when modal closed

by rpayanm   Last Updated December 04, 2018 16:07 PM

I have form with a link (it open modal):

$form['link'] = [
  '#type' => 'link',
  '#title' => t('Title'),
  '#url' => Url::fromRoute('example_module.event_form'),
  '#attributes' => [
    'class' => ['use-ajax'],
    'data-dialog-type' => 'modal',
    'data-dialog-options' => Json::encode([
      'width' => 700,
      'height' => 350,
    ]),
  ],
];

I need update an element in $form when this modal closes, how can I do that?

Tags : 8 modal-dialogs


Related Questions



Modal dialog no longer works in Drupal 8.6.4

Updated January 02, 2019 23:07 PM


modules for login and register?

Updated October 15, 2019 10:07 AM

How to trigger a popup window/overlay in my module?

Updated February 02, 2019 06:07 AM