Page 1 of 1

How can i make a autocomplete textbox?

Posted: Thu Jun 09, 2005 12:45 am
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.

Posted: Thu Jun 09, 2005 12:48 am
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.

Posted: Thu Jun 09, 2005 4:25 am
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:

AJAX based Solution for your problem

Posted: Thu Jun 09, 2005 4:42 am
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

Posted: Wed Jun 15, 2005 1:07 am
by dscythemar
thank you senthilnayagam =)

Posted: Wed Jun 15, 2005 4:55 am
by harrison
On the second thought, this is possible.
http://www.webreference.com/programming/javascript/ncz/

Posted: Wed Jun 15, 2005 5:47 am
by timvw
Offcourse it's possible ;)) http://jpspan.sf.net has some nice examples too..