Autosuggest features are in abundance on the Internet. There are many plugins available for jQuery and jQuery UI which will allow you to add the autosuggest feature to your site quickly and easily. This recipe will show you how to create one from scratch which you can customize and add your own unique features to.
The server-side code for this recipe mirrors that of the previous one. Ensure that you have a web server and a MySQL database server running and ready to use.
The following are the steps to create an autosuggest feature:
Please refer to the previous recipe of this chapter, Creating a search feature, to create and set up a stationary database and the
search.php
script. We will be using the exact same code for the autosuggest feature.Within the web root of your web server, create an HTML file named
recipe-8.html
. Add the following HTML code to create the basics of the autosuggest user interface:<!DOCTYPE html> <html...