0

I'm using jQuery UI 1.10.3 and jQuery 1.10.2 versions for autocomplete a text box. I'm getting suggestions from remote site which return results when i check dev tools.

There haven't show any js errors or warnings. but it shows a label "No search results." even ajax returnresults. this is my code

  var street = $('#txtstreet')
                       street.autocomplete({
                       source: function(request, response) {
                           $.ajax({
                               url: 'https://myurlhere.com',
                               data: {
                                   street: request.term
                               },
                               dataType: "json",
                               success: response
                           });
                       },
                       minLength: 2
                   });

results json

enter image description here

Label shows before textbox

enter image description here

I need to show json label value as a suggetions Anyone know how to fix this issue, Thanks a lot

Suneth Kalhara
  • 1,116
  • 4
  • 16
  • 40
  • 1
    you may take a look to [ajax-jquery-autocomplete-with-json-data](https://stackoverflow.com/questions/14493250/ajax-jquery-autocomplete-with-json-data) – gaetanoM Sep 15 '18 at 17:20
  • @gaetanoM i tired that in success event i return that label value, the label values are correctly passing but still shows no results message without showing results success: function (data) { response($.map(data, function(v,i){ var text = v.label; alert(text); if ( text && ( !request.term) ){ return { label: v.label, value: v.label }; } })); } – Suneth Kalhara Sep 16 '18 at 04:03

0 Answers0