Dan G. Switzer, II wrote:
A while back I added the setOptions() method to allow you to do this exactly
this type of thing. The setOption() method will allow you to update the
original settings you configured.
Using this option you can either physically change the AJAX URL or just
update the extraParams key.
For example:
// change the url parameters
$("input#suggest").setOptions({
extraParams: {
search: $("select#search").getValue();
}
});
// clear the cache so we don't get dirty results
$("input#suggest").flushCache();
In the above example I use my Field Plug-in
(http://jquery.com/plugins/project/field) to get the value a select element
with the id of "search" and update the "search" parameter. The "search"
parameter will automatically be appended to the url and properly encoded.
You'll also want to run the flushCase() method after changing the options to
make sure that you're not using the dirty cache.
-Dan
Hey Dan,
Which version of autocomplete has the setOptions() and flushCache()
methods? I believe that I tried setOptions with Jorn's plugin but it
came back as undefined.
Thanks,
Josh