i am using Ajax Autocomplete for Jquery ( http://www.devbridge.com/projects/autocomplete/jquery/ ) in one of my application. The Search Form looks something lik
As your plugins site specifies in the usage here http://www.devbridge.com/projects/autocomplete/jquery/ it has a setOptions method on the object it returns which you can use later to change options dynamically.
Add a onchange handler on the select element and change the params options each time user selects a different value like
$(function(){
var ac = $('#q').autocomplete({
serviceUrl:'/search',
delimiter: /(,|;)\s*/, // regex or character
maxHeight:400,
width:325,
zIndex: 9999,
params: {entity_type:$('#top_search_select').val()},
deferRequestBy: 0, //miliseconds
noCache: false, //default is false, set to true to disable caching
onSelect: function(value, data){window.location.replace(data);},
});
$("#top_search_select").change(function() {
ac.setOptions({params:{entity_type:$(this).val()}});
});
});
You should put all your code inside document ready.