View Full Version : How do you code something similiar to how google guesses your input on the search box

03-28-2009, 12:22 PM
I'm developing a site where suppliers can sell their products. I have a mySQL database of possible items they can sell. So when you click sell it takes you to a new page with an input box of what you are selling. I would like to create something where lets say you input an 'a' into the box then a clickable list below has values like 'apple', 'antenna', 'ariel', etc. Everything beginning with 'a' is displayed.

Google does this with there search box, you start writing something and it comes up with some possible suggestions of what you are going to type. I just can't think how to write this code, can anyone point me in the right direction? I'm fairly comfortable with JavaScript, PHP, mySQL and CSS.

The reason for posting it here is I would like it still to be possible with JavaScript disabled, however I am doubtful this is possible.


03-28-2009, 12:26 PM
They are using Ajax powered search, take a look at http://www.w3schools.com/php/php_ajax_livesearch.asp

03-28-2009, 12:48 PM
Thanks for the quick reply, I'll read up on that cheers.

03-28-2009, 10:59 PM
here is a better one:

Auto Complete (http://www.lmgtfy.com/?q=ajax+autocomplete)