I'm using jQuery UI autocomplete as described [http://api.jqueryui.com/autocomplete/]
I need to do a few things before and after the search is executed. From reading the documentation at the above URL it describes two methods "search" and "response," that are triggered before and after the query is run - perfect. BUT, if I add these to my code, "search" works perfectly, but "response" is never called. What am I doing wrong? All my code works, no javascript errors, autocomplete works perfectly. But I just dont ever have the "response" method being triggered.
$(function() {
$("#tv").autocomplete({
source: "a_url_providing_json",
minLength: 4,
select: function(event, ui) {
$('#state_id').val(ui.item.id);
$('#abbrev').val(ui.item.abbrev);
},
search : function(a,b) {
alert('this works!');
},
response : function(a,b) {
alert('this doesnt!');
}
})
});
Many thanks for any advice !