Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

jQuery, ajax, php, msyql: auto-suggest form input [closed]

I have a mysql db table that has every U.S. city, state, zip, lat, long. On my site page I have a form input for cities. As the user types, I'd like to suggest city, state. What current practices/techniques are good? (Limitations are jQuery, PHP, MYSQL)

Solution

like image 920
Jeffrey Avatar asked Apr 04 '11 16:04

Jeffrey


1 Answers

jQuery UI has a nice autocomplete feature.

JQuery UI Autocomplete

It is quite well configurable. You should send the data in JSON format from the server, Autocomplete will mostly handle the rest. Check out the docs.

like image 103
kapa Avatar answered Nov 19 '22 10:11

kapa