Hot answers tagged

2 votes

Revolution slider issue with AjaxResponse

JsonResponse::create() was deprecated and is in the current Symfony version no longer available. It did not added any features other than that you need now an extra pair of brackets for daisy-chaining:...
4uk4's user avatar
  • 99.2k
2 votes

Loading webform in modal is too slow

The core team is working on cacheable Ajax requests. The first project using it is Views. Modals might be next. Until then you could deliver the hidden webform together with the cached page and unhide ...
4uk4's user avatar
  • 99.2k
1 vote

Rendering for AJAX

This is how I got it to work. Thanks to Angrytoast on Slack for the pointer! public function paginateListing(Request $request) { $rc = new RemindersController(); \Drupal::service('...
Cy Jobes's user avatar
1 vote

Can't access data posted from Dialog.ajax to dialog box

You have to replace the data key with submit. Drupal.ajax() transfers the submit key to the data key of $.ajax() but ignores a data key already set: var exportActionDialog = Drupal.ajax({ dialog: ...
4uk4's user avatar
  • 99.2k
1 vote

How to access validated values after AJAX callback when fields are nested in a container?

Ultimately, my issue was caused by my use of #limit_validation_errors on my button (something that I had very unfortunately omitted from my original question's example code). My example code in the ...
sonfd's user avatar
  • 7,871
1 vote

How to access validated values after AJAX callback when fields are nested in a container?

In the first Ajax request fired, the form is rebuilt with empty values and should return exactly the same form build as the original build. The only difference is that the raw input data is present, ...
4uk4's user avatar
  • 99.2k
1 vote
Accepted

When a custom form is displayed in a custom template, ajax does not work

The only variable available in a #theme form template is {{ form }} and this is the only thing you need to render. If you render single form elements or groups then include the rest of the form ...
4uk4's user avatar
  • 99.2k
1 vote

Use AJAX On Node Add Form To Change Field Required Status

Changes to the form must be made in the form definition, and cannot be made in the ajax callback, as Drupal has already cached the form by the point of the ajax callback, so even if you figured out a ...
Jaypan's user avatar
  • 17.4k
1 vote

How to display more than 10 items in link widget autocomplete?

There is an issue on Drupal.org to extend link widget to have limit and operator settings the same way as for entity reference autocomplete widget https://www.drupal.org/project/drupal/issues/3341689#...
Artem's user avatar
  • 11

Only top scored, non community-wiki answers of a minimum length are eligible