Hello,
I would Like to write a ajax page that Autocompletes that shows the most possible choices for what they have typed (using street names). I am going to be using a mysql database.
Hello,
I would Like to write a ajax page that Autocompletes that shows the most possible choices for what they have typed (using street names). I am going to be using a mysql database.
Your solution can be roughly broken into the following tasks:
- Design a web page as per your requirement
- Attach a listener to the key handler which monitors keystrokes pressed inside the search text box.
- In that listener, create a XHR (XMLHttpRequest) object which asynchronously polls the server script [JSP/PHP/Perl etc.] with the data entered by the user with the response being all the possible choices for the given keyword. Use XML / JSON as your data format for shipping data.
- With the data received from the server, create a dynamic DIV which will be placed below the text area displaying all the possible choices in a list. [Rendered using a TABLE or Ordered List / Unordered List]
- Rinse and repeat.
We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.