New answers tagged

0 votes

trigger('RefreshView') problems with pagination

This is a long time bug in views. I remember I just had a lot of trouble with it on a web site years ago. Take a look at this: https://www.drupal.org/project/drupal/issues/3100826
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 ...
  • 16.4k
0 votes

How to redirect custom ajax form to external url with headers

No, you cannot set headers in the same way as you do in RedirectResponse() when using RedirectCommand in an AJAX callback. The reason is that RedirectCommand uses JavaScript to redirect the user to ...
0 votes
Accepted

Add a text field value with AJAX

I finally found out a solution here: AJAX form - replacing #default_value not working (the '2021 edit...') In this specific case, the callback would work: function myAjaxCallback(array &$form, ...

Top 50 recent answers are included