View Full Version : PHP and AJAX autosuggest/autocomplete function?
06-05-2009, 04:10 PM
Does anyone know of a ready to run PHP and AJAX autosuggest/autocomplete function that they have used with success?
I've found many promising leads via a Google search but they tend to be missing a crucial element such as being keyboard navigable, or only cover the AJAX side of things.
I figure someone on here almost certainly has found one that does the job, however.
Thanks in advance.
06-05-2009, 07:15 PM
jQuery has some nice plugins. This one looks good:
Oh this one is nice too:
You may like this one better though:
Oh wow check this one out, it handles multiple selections in an interesting way:
06-05-2009, 10:42 PM
I'm really thinking of changing it for the last one on your list now though as it looks and performs 100x better. Thanks!
06-06-2009, 01:38 PM
Thanks Fumigator. None of these actually give me any PHP code, but what I'm realising is that the PHP part of this is really simple and not worth providing code for.
So, when I'm told something like this:
Web page that provides data for Ajax Autocomplete, in our case autocomplete.ashx will receive GET request with querystring ?query=Li, and it must return JSON data in the following format:
suggestions:['Liberia','Libyan Arab Jamahiriya','Liechtenstein','Lithuania'],
Does that mean, essentially, that autocomplete.ashx (or .php in my case) outputs literally the above in text format?
06-20-2009, 07:55 PM
I realise this thread is now 2 weeks old, but maybe the poster still wants an answer.
Yes, the search results provided by your php or whatever script has to return valid JSON encoded data. PHP has support for this - just make sure that the json.so (.dll on Windows) extension is loaded.
Powered by vBulletin® Version 4.2.2 Copyright © 2017 vBulletin Solutions, Inc. All rights reserved.