How can i make a autocomplete textbox?

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
dscythemar
Forum Newbie
Posts: 2
Joined: Thu Jun 09, 2005 12:40 am

How can i make a autocomplete textbox?

Post by dscythemar »

helo guys, im a n00b in php, i would like to ask how to make an autocomplete textbox wherein u type in the value and on change it select from mssql table the corresponding field "like" the value that is typed.

Thanks in advance. hope u guys can help me up asap.
Syranide
Forum Contributor
Posts: 281
Joined: Fri May 20, 2005 3:16 pm
Location: Sweden

Post by Syranide »

First up, you should take a look at what PHP is, meaning PHP is a serverside language which cannot do such things.

Second, you cannot make autocompleteboxes, IE has that feature and you cannot modify it, only turn it off... or create your own in JScript.
User avatar
onion2k
Jedi Mod
Posts: 5263
Joined: Tue Dec 21, 2004 5:03 pm
Location: usrlab.com

Post by onion2k »

Syranide wrote:Second, you cannot make autocompleteboxes, IE has that feature and you cannot modify it, only turn it off... or create your own in JScript.
you cannot make autocompleteboxes ... create your own in JScript

:wink:
User avatar
senthilnayagam
Forum Newbie
Posts: 17
Joined: Wed Jun 08, 2005 5:36 am
Location: Bangalore

AJAX based Solution for your problem

Post by senthilnayagam »

Hi,

I will not dismiss your request as silly or not php post.

There is something called AJAX(AJAX : Asynchronous JavaScript + XML)
which can do the trick for you

check the article on my site

these are the opensource php projects whch can help you not doing JS but the PHP part

Sajax
JPSPAN
SSRS
JSRS

Google Suggest
Google Maps
LiveSearch( the kind of code you want) check the search button
Zuggest

hope this will help you get started :)

but mind if your site has lot of hits you need to architect your site so as it is effective, AJAX causes lot of traffic between site and server

you must learn how to optimsie your code and use client side/server side cacheing

regards
Senthil
dscythemar
Forum Newbie
Posts: 2
Joined: Thu Jun 09, 2005 12:40 am

Post by dscythemar »

thank you senthilnayagam =)
User avatar
harrison
Forum Commoner
Posts: 30
Joined: Thu Jun 09, 2005 12:23 am

Post by harrison »

On the second thought, this is possible.
http://www.webreference.com/programming/javascript/ncz/
timvw
DevNet Master
Posts: 4897
Joined: Mon Jan 19, 2004 11:11 pm
Location: Leuven, Belgium

Post by timvw »

Offcourse it's possible ;)) http://jpspan.sf.net has some nice examples too..
Post Reply