improve autocomplete.js

Created on 24 July 2015, almost 9 years ago
Updated 14 December 2023, 7 months ago

Sometimes, it is very handfull to pass to autocomplete route additional parameters, not only the text that come from input textfield.

Example: Form with field "City" (select) and "Street" (autocomplete). I want to search streets only in chosen city.

Yes, I know I can make "#ajax" property for "City" field, then on form ajax rebuild pass the city id to "'#autocomplete_route_parameters' => array('city' => 13)," property of "Street" form field. (I didn't test that way yet).

But there is a way better, without additional ajax requests.

I want to add custom js library, that handle changes of "City" field, and on change it would do something like this:

jQuery.extend(true, Drupal.autocomplete.ajax, {data: {city: 13}});

But then autocomplete should make recursive merge of Drupal.autocomplete.ajax. Please see the patch and jQuery.extend doc: http://api.jquery.com/jquery.extend/

✨ Feature request
Status

Closed: outdated

Version

11.0 πŸ”₯

Component
AjaxΒ  β†’

Last updated 15 minutes ago

Created by

πŸ‡·πŸ‡ΊRussia andyceo

Live updates comments and jobs are added and updated live.
Sign in to follow issues

Comments & Activities

Not all content is available!

It's likely this issue predates Contrib.social: some issue and comment data are missing.

Production build 0.69.0 2024