Drupal has a very well-architected, jQuery-based autocomplete.js. Usually, you don’t have to bother with it, since it’s configuration and execution is handled by the Drupal form API.
Now, I need a way to reconfigure it at runtime (with JavaScript, that is). I have a standard drop down select box with a text field next to it, and depending what option is selected in the select box, I need to call different URLs for autocompletion, and for one of the options, autocompletion should be disabled entirely. Is it possible to reconfigure the existing autocomplete instance, or will I have to somehow destroy and recreate?
Well, for reference, I’ve thrown together a hack that works, but if anyone can think of a better solution, I’d be happy to hear it.
This code comes from the ding_campaign module. Feel free to check out the code if you need to do something similar. It’s all GPL2.