views:

13601

answers:

9

I usually use jQuery as my JS library on my sites, and I would like to stick with it since I'm familiar with it.

I need to implement an AJAX autocomplete, mainly for suggesting search results. Here are a few I have found:

If you have tried any of these plugins, were you happy with them? Which one do you think is the most (and easily) customizable?

+24  A: 

I was recently on a similar mission and I eventually settled with jQuery UI's autocomplete. I am currently using jQuery UI 1.6rc2 and the autocomplete plugin is very well implemented and customizable. Here's an example:

<script type="text/javascript" src="jquery-1.2.6.js"></script>
<script type="text/javascript" src="ui.core.js"></script>
<script type="text/javascript" src="ui.autocomplete.js"></script>

<script type="text/javascript">
$('#search').autocomplete({
  url: 'suggestions.php',
  width: 300,
  max: 10,
  delay: 100,
  cacheLength: 1,
  scroll: false,
  highlight: false
});
</script>
Joe Lencioni
works great, very easy to read/modify the code too. thanks!
Murat Ayfer
how do you give it a function to execute when the user chooses a value from the autocomplete results?
Horace Loeb
Thanks for this. I didn't know that it's merged to jQuery UI now.
jpartogi
"As of jQuery UI 1.7, the autocomplete plugin is not part of the stable release of jQuery UI." ...not anymore :(
Stephen J. Fuhry
autocomplete is a part of jquery UI 1.8 again
Zeus
Yes it is in the 1.8, but I seems to have problem when I try to have scroll bar (vertical)
Nordes
+1  A: 

I tried a number of them, ended up with YUI's autocomplete (yes, for use with jQuery), it's worked well for me so far. You can use YUI's Loader facility to make it a fairly painless download and keep page loading times good.

Parand
+9  A: 

Autocomplete has been removed from the latest JQuery UI (since 1.6rc3). And the one you found in 1.6rc2, won't work with later version.

However, this guys has modified the code and make it work with later version.

http://pastie.org/362706

http://osdir.com/ml/jquery-ui/2009-01/msg00002.html

kimsk
Why was it removed?
Mark
I think because it wasn't being maintained.
Jess
+13  A: 

Check out: http://www.devbridge.com/projects/autocomplete/jquery/

Tomas Kirda
I've been using this plugin and it is very flexible and provides good functionality.
ChrisP
+4  A: 

This is quite easy-simple to integrate .This has got a lot of options with it

http://bassistance.de/jquery-plugins/jquery-plugin-autocomplete/ http://jquery.bassistance.de/autocomplete/demo/

Shyju
+2  A: 

As of today, only Dylan Verheul's version worked for me without issues.
I tried the others but I was going crazy juggling between xml and json data output formats from PHP.
Dylan's gives a simple plain text option (JSON and XML are not difficult, just that if plain text works, you might find it easy and useful).
The server side code for the example is tiny if you ignore the data array.
I used the autocomplete.css from Jörn Zaefferer's version with the source on Dylan's page ... works fine.

namespaceform
I'd like to mention that the maintained version of this plugin now lives at http://code.google.com/p/jquery-autocomplete/
dyve
+2  A: 

There's a rewrite of my autocomplete up on http://code.google.com/p/jquery-autocomplete/ (in an attempt to properly open source it). Please report any issues you find on the Google Code project.

That said, I fully endorse Jörn's excellent work on a jQuery UI autocomplete and his version will probably be more powerful/customizable eventually.

Dylan Verheul

dyve
A: 

You can find a simple autocomplete plugin on

http://blog.idealmind.com.br/projetos/simple-autocomplete-jquery-plugin/

It's a plug and play plugin with callback functions, and you can use multiple autocomplete on the same page.

Wellington RIbeiro
+5  A: 

As of jQuery UI 1.8.1, autocomplete is standard with the library.

Anthony Potts