autocomplete problem
autocomplete problem
hi,
I have a problem with jquery autocomplete.
The issue is that the autocomplete doesn't work, but if I change the focus and then change it back(like TAB, SHIFT+TAB) it works just fine.
Here is the code:
-
$(document).ready(function() {
$("#client_id").keyup(function(){
var str = $("#client_id").attr("value");
if(str.length > 1) {
getClients("?q="+str+"&action=search", "pages/clients.php");
}
});
function getClients(str, file) {
var data;
var request = $.ajax({
type: "GET",
url: file+str,
success: function(html){
data = html.split("|");
$("#client_id").autocomplete(data);
}
});
}
});
Can you help me?