Jquery Autocomplete display results
-
Hi !
I am using JQuery Autocomplete and I do not know how to display my results. The request works because I have this (in the development tool of Chrome) :
{0: “com”, 1: ” commerciale”, 2: “Comment”, 3: “COMMANDATION”, 7: “Com”, 10: ” communication”,…}
0:”com”
1:” commerciale”
2:”Comment”
3:”COMMANDATION”
7:”Com”
10:” communication”
12:” Comexposium”
15:”commerce”
17:” comment”
20:” compl”
22:” Comment”
27:” comp”
35:” commerciales”
36:” compte”
37:” compter”
40:”commandation”
42:”↵compl”
43:” compr”
44:”compatibilit”
45:”commandations”
47:” commerciaux”
51:” comporter”
52:”Compte”
53:” communicants”
54:”compagne”
56:” communicant”
59:”↵comme”
61:”communication”
62:” compose”Here is my code :
JS:
$("#rech-nav").autocomplete({ source: function(request, response) { $.ajax({ type: "GET", url: "/cimaya/wp-content/themes/cimaya/autocomplete.php?term="+$(".rech-q").val(), dataType: "json", success: function(data) { response(data); } }); }, appendTo: "#rech-nav", autoFocus: true, minLength: 2, });
HTML :
<form id="rech-nav" name="rech-nav" action="/cimaya/resultats/" method="get" class="ui-autocomplete-input ui-autocomplete-loading" autocomplete="off"> <div class="hp formr"> <div class="ch-q"> <input name="q" class="rech-q" type="text" placeholder="Recherche par mots clés "> <button type="submit" id="rech" name="rech"><i class="fa fa-search"></i></button> </div> </div> <ul class="ui-autocomplete ui-front ui-menu ui-widget ui-widget-content" id="ui-id-1" tabindex="0" style="display: none;"></ul> </form>
Thanks for your help !
- The topic ‘Jquery Autocomplete display results’ is closed to new replies.