Predictive Text -- Drop Down Menu

PHP programming forum. Ask questions or help people concerning PHP code. Don't understand a function? Need help implementing a class? Don't understand a class? Here is where to ask. Remember to do your homework!

Moderator: General Moderators

Post Reply
iwidesign
Forum Newbie
Posts: 2
Joined: Thu Aug 05, 2004 8:35 am

Predictive Text -- Drop Down Menu

Post by iwidesign »

I have a drop down menu whose contents are generated from my database and I would like to add a function so that the appropriate listing is highlighted in the menu when letters are typed... kind of like predictive text on your phone ... where u enter three letters and it goes to the place in the menu starting with those three letters, rather than it highlighting the listing beginning with each letter pressed ... does that make sense?

Any ideas????
User avatar
feyd
Neighborhood Spidermoddy
Posts: 31559
Joined: Mon Mar 29, 2004 3:24 pm
Location: Bothell, Washington, USA

Post by feyd »

[php_man]preg_match[/php_man]() if this is done server-side.. if client side, the browsers generally support it already...
iwidesign
Forum Newbie
Posts: 2
Joined: Thu Aug 05, 2004 8:35 am

server side

Post by iwidesign »

I would rather do it server side ... how do I do this ????
User avatar
feyd
Neighborhood Spidermoddy
Posts: 31559
Joined: Mon Mar 29, 2004 3:24 pm
Location: Bothell, Washington, USA

Post by feyd »

thinking about it, if you want the page to be responsive, you'll need some level of javascript involvement.. otherwise, you'll have to ask them to write out the first x letters/numbers in a text field they submit, and you pull up all the matches..

I think it'd be better to let the browser handle it, and it's more an OS level implementation helper
Post Reply