devbridge / jQuery-Autocomplete

Ajax Autocomplete for jQuery allows you to easily create autocomplete/autosuggest boxes for text input fields
https://www.devbridge.com/sourcery/components/jquery-autocomplete/
Other
3.56k stars 1.66k forks source link

Not gets results with the typed word #77

Closed Rafaelmignoni closed 11 years ago

Rafaelmignoni commented 11 years ago

Not gets results with the typed word.

If I use it this way this ok, the results(United Arab Emirates", "United Kingdom", "United States) will be refined.

Ex: if i type "emi" will get just "United Arab Emirates"

$(document).ready(function() { var suggestions = ["United Arab Emirates", "United Kingdom", "United States"];

$('#autocomplete-ajax').autocomplete( {
        lookup: suggestions
});

});

but if i use in this way, the result is not refined.

{ "suggestions": [ "chevrolet", "ford", "hyundai",....

Ex: if i type "yun" will get all the results(cehvrolet,ford,hyundai,...), but hyundai will be "yun" in bold

$(document).ready(function() {

$('#autocomplete-ajax').autocomplete(
{       
    serviceUrl: 'data.php',
    dataType: 'json'                   
});

});

tkirda commented 11 years ago

Your question is all messed up. If you don't know how to use the plugin ask on http://stackoverflow.com/ . This is not a forum.