I have a list of 400+ names I am getting from a mysql database. They are listed out in a table. I would like to have a text box where once you start typing, the string highlights below, the more I type the less matches come about (will and william for example).
sw41
0
Newbie Poster
Recommended Answers
Jump to PostSo basically, you're asking for something similar to Google autosuggest, except with names?
Try this:
<html> <body> <script type="text/javascript"> function suggest(e, o) { var suggestDiv = document.getElementById('suggest'); var namesList = new Array(); namesList.push("Will"); namesList.push("Bob"); namesList.push("Joe"); namesList.push("William"); namesList.push("Jared"); var suggest = new Array(); var i; var keychar …
Jump to PostHmm, try using this script as a guide:
http://4umi.com/web/javascript/hilite.php
Except clear the results, then call it again on each keypress.
All 6 Replies
itsjareds
29
Junior Poster
sw41
0
Newbie Poster
itsjareds
29
Junior Poster
essential
84
Posting Shark
Featured Poster
infamousjre
0
Newbie Poster
infamousjre
0
Newbie Poster
Be a part of the DaniWeb community
We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.