First time here? Check out the FAQ!

Revision history  [back]

These settings worked for me, make sure and bear in mind the stopCharRegex, any character here will cause the autocompleter to stop. The default setting for this stopped on spaces which was causing me most of my problems.

{%- macro location_autocomplete_js(id = '#id_location') -%}
    var locationAc = new AutoCompleter({
            url: '{% url "get_location_list" %}',
            minChars: 3,
            useCache: true,
            maxCacheLength: 100,
            matchInside: false,
            autocompleteMultiple: false,
            multipleSeparator: null,
            delay: 10,
            stopCharRegex: /\./
    });
    locationAc.decorate($("{{ id }}"));
{%- endmacro -%}