Score:0

Can I bind ajax to form or document?

km flag

I would like to bind an update to entity browser select.

It is a standard ajax form response. Update the default value of another field.

If I apply the ajax to the inline entity browser form field it breaks the entity browser.

The trigger field is 'field_bond_issuer' the target is 'field_bond_country'. Setting the trigger to the trigger field breaks the selection. The target doesn't work:

 $form['field_bond_country']['widget'][0]['value']['#ajax'] = [
  'callback' => '::defaultCountryCurrency',
  'event' => 'entities-selected', // From entity_browser
  'wrapper' => 'edit-field-bond-country-wrapper',
];
}

I really just want $('form').on('entities-selected') to trigger the next ajax call.

How is this done?

mangohost

Post an answer

Most people don’t grasp that asking a lot of questions unlocks learning and improves interpersonal bonding. In Alison’s studies, for example, though people could accurately recall how many questions had been asked in their conversations, they didn’t intuit the link between questions and liking. Across four studies, in which participants were engaged in conversations themselves or read transcripts of others’ conversations, people tended not to realize that question asking would influence—or had influenced—the level of amity between the conversationalists.