New answers tagged

3 votes

AJAX in a plugin form results in "The specified #ajax callback is empty or not callable."

Thanks to Clives link, for reasons I am not 100% on the configuration forms for a Context plugin the AJAX callback needs to do this: /** * Trigger form rebuild. * * @param array $form * @...
user avatar
  • 26.3k
0 votes

How to refresh and reload (with ajax?) order checkout panes and order calculation independent from commerce cart refresh (e.g. billing address change)

So you want to refresh some content in the page that's not part of the checkout form? Basically, this can be done using an Ajax callback and one or more Ajax callback commands: https://www.drupal.org/...
user avatar
  • 101
0 votes

How to add an unique wrapper id to a widget element?

If you have multiple wrappers on the same page you can't rely solely on Html::getUniqueId. You need to add as much predictable information as available. For example in a single field widget element ...
user avatar
  • 86.8k
1 vote
Accepted

Overriding Drupal.ajax.prototype is not working

There are two javascript objects: Drupal.ajax Drupal.Ajax You have to override the prototypes in Drupal.Ajax. For each Ajax object declared in Drupal settings an instance of it will then be stored ...
user avatar
  • 86.8k
0 votes

Can I add elements to a field widget with AJAX?

The point is, you can't modify Drupal's internal form structure in an Ajax callback. So you'll need a submit handler, either for the field or for the complete widget, do the form modifications there ...
user avatar
  • 101

Top 50 recent answers are included