views:

36

answers:

0

I'm using jquery.autocomplete and users are seeing the following behaviour:

  1. user starts typing a string and suggestions are presented
  2. user keeps typing until no suggestions are valid any longer (and drop down goes away)
  3. user hits tab
  4. autocomplete fills the field with an invalid previous suggestion, wiping away what the user had typed

Any ideas?

This is the javascript code (from Django template):

    $("#id_name").autocomplete("{% url name_autocomplete %}", {
         formatItem: function(data, i, n, value) {
             values = value.split(",,");
             return values[0];
         },
         formatResult: function(data, value) {
             return value.split(",,")[1];
         },
         highlight: false
     });