1

Here is the js code for jquery autocomplete in Rails 4.2 app:

   $(this).autocomplete({
        minLength: 1,
        source: $(this).data('autocomplete-source'),
        select: function(event, ui) {
            $(this).val(ui.item.value);
        }
    });

When there is no hit, on the low left corner of the page, there is a message saying No search results.. Here is the html source code:

<span class="ui-helper-hidden-accessible" role="status" aria-live="assertive" aria-relevant="additions">
  <div>No search results.</div>
</span>

Also in the same spot, user selection will show in full text. We don't quite understand what makes this message showing on the page. How can we make this message showing in autocomplete box and I18n.t it with our own?

user938363
  • 9,990
  • 38
  • 137
  • 303
  • http://stackoverflow.com/questions/13011127/how-to-remove-change-jquery-ui-autocomplete-helper-text. here is a post which may answer the question where the message comes from. – user938363 Jul 24 '15 at 23:29

1 Answers1

1

This example can help you:

$("#find-subj").autocomplete({
    source: availableTags,
    messages: {
        noResults: '',
        results: function() {}
    }
});
Bugs
  • 4,491
  • 9
  • 32
  • 41