views:

111

answers:

2

jQuery UI Autcomplete:

How can I POST the term to the search script instead of GET?

+1  A: 

You'll need to supply a function as the source for the plugin and have your function do the AJAX post to the server to get the matching data.

tvanfosson
thanks, this is how it ended up working:$("#search-cities").autocomplete({ minLength: 2, source: function(request, response) { jQuery.post("http://redcupclassifieds.com/search_cities", { term: request.term }, function(data) { response(data); }, "json"); }});
andrhamm
A: 

You need to specify callback function for the source parameter. Here is an example: http://jqueryui.com/demos/autocomplete/#remote-jsonp

Ivo Sabev