Ajax callback on Views exposed form filter I'm trying to add an #ajax callback method to my views exposed form filter select box.
But it seems the form have some issues with the callback.
My code is pretty simple
/**
 * Implements hook_form_FORM_ID_alter() for views_exposed_form.
 */
function mymodule_form_views_exposed_form_alter(&amp;$form, FormStateInterface $form_state) {
  if ($form['#id'] == 'views-exposed-form-viewid') {
    $op = ['hi' =&gt; 'hi', 'all' =&gt; 'all'];
    $form['test'] = [
      '#type' =&gt; 'select',
      '#name' =&gt; 'test',
      '#empty_option' =&gt; 'none',
      '#options' =&gt; $op,
      '#ajax' =&gt; [
        'callback' =&gt; '_my_call',
        'event' =&gt; 'change',
        'wrapper' =&gt; 'edit-output-test',
        'progress' =&gt; [
          'type' =&gt; 'throbber',
        ],
      ],
    ];

    $form['callfield'] = [
      '#type' =&gt; 'select',
      '#options' =&gt; [],
      '#prefix' =&gt; '&lt;div id=&quot;edit-output-test&quot;&gt;',
      '#suffix' =&gt; '&lt;/div&gt;',
    ];
  }
}

function _my_call(array &amp;$form, FormStateInterface $form_state) {
  $response = new AjaxResponse();
  $message = 'test';
  $response-&gt;addCommand(new HtmlCommand('#edit-output-test', $message));
  return $response;

}

When I try to change the 'test' select box from view edit screen I get the below error
&quot;Symfony\Component\HttpKernel\Exception\HttpException: The specified #ajax callback is empty or not callable. in Drupal\Core\Form\FormAjaxResponseBuilder-&gt;buildResponse() (line 67 of /var/www/mypoc/docroot/core/lib/Drupal/Core/Form/FormAjaxResponseBuilder.php).&quot;
When I change the filter from the front end I get the following error
&quot;An unrecoverable error occurred. The uploaded file likely exceeded the maximum file size (32 MB) that this server supports.&quot;
And I see a lot of similar issues -
Ajax callback is not working on views exposed filters
Ajax submission leads to =&gt; An unrecoverable error occurred. The uploaded file likely exceeded the maximum file size (2 MB) that this server supports
Any working example would be great!
Thanks.
Sounds like there is an ongoing core issue queue -
https://www.drupal.org/project/drupal/issues/2842525
After applying the patch -
https://www.drupal.org/files/issues/2020-03-27/2842525-83.patch this seems to work.