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?

Your Answer

By clicking "Post Your Answer", you acknowledge that you have read our updated terms of service, privacy policy and cookie policy, and that your continued use of the website is subject to these policies.

Browse other questions tagged or ask your own question.