Drop Down search text box

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
biswa
Forum Newbie
Posts: 2
Joined: Tue Jul 01, 2008 7:42 am

Drop Down search text box

Post by biswa »

Hello ,
Can somebody help me .
I have a simple search text box on the web page. I would like people to start typing someone
name and as soon as they type, it will show the people with that name stored in the database(It may use ajax), for example if they start typing 'a' it will show all the people with their name beginning with 'a' if they continue and type 'ab' it will filter to show everyone with their name beginning with 'ab' .
If they type 'abcd' it will filter again to show everyone with their name beginning with 'abcd' - exactly the same as gmail..



Thanks,
User avatar
jaoudestudios
DevNet Resident
Posts: 1483
Joined: Wed Jun 18, 2008 8:32 am
Location: Surrey

Re: Drop Down search text box

Post by jaoudestudios »

You will have to use ajax to do that.

Its called an autocomplete form.

There are hundreds of good tutorials and examples out there on the web. You cant expect anyone to rewrite one for you. I know for a fact searching on google will bring plenty of good results.
biswa
Forum Newbie
Posts: 2
Joined: Tue Jul 01, 2008 7:42 am

Re: Drop Down search text box

Post by biswa »

jaoudestudios wrote:You will have to use ajax to do that.

Its called an autocomplete form.

There are hundreds of good tutorials and examples out there on the web. You cant expect anyone to rewrite one for you. I know for a fact searching on google will bring plenty of good results.

thanks for help
if you have links, from which i can get code for "autocomplete form" which shows data from database using Ajax, please send me.
i appreciate your help.
thanka & regards
User avatar
jaoudestudios
DevNet Resident
Posts: 1483
Joined: Wed Jun 18, 2008 8:32 am
Location: Surrey

Re: Drop Down search text box

Post by jaoudestudios »

I just did a search on google and like I said before there are many good examples and tutorial out there, I picked one for you :)

http://nodstrum.com/2007/09/19/autocompleter/

Most of then use the prototype library. There are a few that use the Json library which is slightly faster.

Enjoy
Post Reply