PHP Developers Network

A community of PHP developers offering assistance, advice, discussion, and friendship.
 
Loading
It is currently Thu Aug 06, 2020 5:04 pm

All times are UTC - 5 hours




Post new topic Reply to topic  [ 2 posts ] 
Author Message
 Post subject: How to autopopulate
PostPosted: Wed Sep 21, 2016 4:03 am 
Offline
Forum Newbie

Joined: Sat Sep 10, 2016 5:29 am
Posts: 1
How can I autopopulate things in dropdown like I want that if I type 'a' every thing starting with 'a' should apppear?


Top
 Profile  
 
 Post subject: Re: How to autopopulate
PostPosted: Wed Sep 21, 2016 7:37 am 
Offline
Spammer :|
User avatar

Joined: Wed Oct 15, 2008 2:35 am
Posts: 6617
Location: WA, USA
If it's a short list of items then HTML 5 has : you put the list into the HTML and let the browser do the rest.

If it's a long list, like if you need to search your database, then the answer is AJAX: do a request when the user types to a PHP script, which includes what the user has typed, it does the database query or whatever to get the results, and they are returned to the Javascript code which displays the results. Using a library or plugin makes all that much easier - all you need to do is write the PHP code.


Top
 Profile  
 
Display posts from previous:  Sort by  
Post new topic Reply to topic  [ 2 posts ] 

All times are UTC - 5 hours


Who is online

Users browsing this forum: No registered users and 6 guests


You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot post attachments in this forum

Jump to:  
cron
Powered by phpBB® Forum Software © phpBB Group