Jquery ui autocomplete different source
Posted
by voidnull
on Stack Overflow
See other posts from Stack Overflow
or by voidnull
Published on 2010-06-07T17:30:30Z
Indexed on
2010/06/07
17:32 UTC
Read the original article
Hit count: 185
jQuery
|autocomplete
Hi
i try to use jquery ui autocomplete. I have different autocomplete field in one page and i need to get data with different sources (different url) depend to wich autocomplete field is used. i know how can i get the typed data (request.term), but i cant find the way to get the selected field ID.
$(".ac").autocomplete({
source: function(request, response) {
id = '??? the actually used field #id ???';
$.ajax({
type: "POST",
url: "/admin_/sql/autocomplete/"+id,
data: "test=...",
async: false,
success: function(data) {
}
});
},
search: function() {
//
},
focus: function() {
//
return false;
},
select: function(event, ui) {
//
return false;
}
});
© Stack Overflow or respective owner