Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Google's autocomplete in my form

I have a form on my website which forwards the textbox input to www.google.com/search?q=.... Is there any possibility to get this autocomplete / autofill features google provides when searching over google.com. Firefox uses google's autocomplete function in the search bar next to the url bar, but how can I get this kind of information for my web form?

like image 733
ccg Avatar asked May 04 '12 20:05

ccg


2 Answers

There was the Google Suggest API that allowed to use autocomplete on custom keywords. But it seems google has removed it. But I found out that you can still access the API. There are URLs for JSON and XML.

JSON

http://clients1.google.com/complete/search?hl=en&q=<your query here>&client=hp

XML

http://clients1.google.com/complete/search?hl=en&q=<your query here>&output=toolbar

Without any warranty.

If you want to get autocomplete on a text box. You can combine that with jQuery UI Autocomplete

like image 122
iblue Avatar answered Nov 08 '22 17:11

iblue


Here an complete example with google auto suggest

http://googlesuggest-jquery.googlecode.com/svn/trunk/

like image 28
ceasar Avatar answered Nov 08 '22 16:11

ceasar