I want to create multi autocomplete but i can just created single one.
It has to work with different query.
My code like this.
$(document).ready(function(){
$("#arama").keyup(function(){
data_getir($(this).val());
});
});
function data_getir(aranan)
{
$.ajax({
type: "POST",
url: "web.asmx/oku?aranan=" + aranan, //web service ve methodumuz
data: "{adres:'complete.ascx'}",
contentType: "application/json; charset=utf-8",
dataType: "json",
success: function(msg){
$("#goster").html(msg.d)
}
});
}
function sec(kontrol){$("#arama").val($(kontrol).html()); $("#goster").html("");}
<div>
<input id="arama" type="text" style="width:150px; height:20px; font-size:11pt;" />
<div id="goster"></div>
</div>
And js: jquery-1.2.6.pack.js
How can i use it with another query in same page ?
just generate a new function and bind it to the other input you want to use as autocomplete field, there’s no limit to how many autocomplete you can have in one page.