I know that jquery ui use ‘term’ for filter data.
my problem is : how if i want to use multi field for filter data?
city as param1, and name as param2.
here is my autocomplete.
city='Jakarta';
$('#txt_name').autocomplete({
source:path+'get_person.php?country='+city,
select:function(event, ui){
alert(ui.item.name);
}
});
thank’s before.
Your first parameter will be used as the filter and passed along as
'term'. You can additionally pass other parameters via the URL, assuming they are accessible dynamically like so:Where your form contains two input elements ID’d as
'name'and'city'.Then, in your script that performs the query, you’d have access to the filter with
$_GET['term'], and access to your city and name variables with$_GET['city']and$_GET['name'], respectively.Of course, it looks like you will be searching for a person and filtering by their name? In that case, you don’t even have to pass along
&name=...astermwill contain the filter data you are looking for.