Re: php / mysql / js search result question

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



You're right when you say this has nothing to do with PHP. Well, mostly
right. I don't believe he is looking for a select box solution. I believe
what is being looked for is a Google Suggest style input box auto-complete
solution. Now you were right to say this is heavily dependant on JavaScript
or Flash (though flash would be a very bad soultion for this).

Check out this link: http://www.papermountain.org/demos/live/

It contains a tutorial for developing a JavaScript XMLHTTPRequest style
auto-complete input box. In fact, the liveUpdater tool that he uses is so
good that I ended up using it as a model for my own AJAX toolkit.

On 12/30/05, Richard Lynch <ceo@xxxxxxxxx> wrote:
>
> On Tue, December 27, 2005 2:03 am, Dave Carrera wrote:
> > I have a very long list of customer names which i know is easy to get
> > from a mysql result using php, no prob there.
>
> How long is very long?...
>
> > But what i would like to do is offer input box and when the user
> > enters
> > a letter, i think this will require client side onchange(), the full
> > list, i think might be in an iframe, will move to the first instance
> > of
> > user input.
> >
> > Example:
> >
> > 1 Alpha Customer
> > 2 Apple Customer
> > 3 Beta Customer
> > 4 Crazy customer
> > 5 Doppy customer
> >
> > User input is "a" so the list moves to first instance of "a".  User
> > continues to input "ap" so the list moves to "2 Apple Customer" and so
> > on.
>
> *IF* your visitor is using a decent browser and OS, then that's
> EXACTLY how this works:
>
> <select size="10">
>   <option>Alpha Customer</option>
>   <option>Apple Customer</option>
>   .
>   .
>   .
> </select>
>
> On crappy systems, only the FIRST letter they type "counts".  So they
> can jump to "A" but not to "Ap" for Apple.  Ugh.
>
> But you should not be dumping a VERY long list to the browser --
> Anything more than a few hundred (and that's pushing it) should
> probably not be in a list of choices.
>
> I've got one such list with 2000 in it, but ONLY for an Intranet where
> I know it's always high-bandwidth and trusted/trained users.
>
> At any rate, this is all browser side, and so it has NOTHING to do
> with PHP.
>
> You'll need to research JavaScript and Flash choices to get on to the
> browser side of things.
>
> I've also had good luck with giving an 'a b c d e ... z' and paging
> navigation for larger sets.  Up to a point.
>
> At some point, you really do need to have a search input box and go
> from there.
>
> --
> Like Music?
> http://l-i-e.com/artists.htm
>
> --
> PHP General Mailing List (http://www.php.net/)
> To unsubscribe, visit: http://www.php.net/unsub.php
>
>

[Index of Archives]     [PHP Home]     [Apache Users]     [PHP on Windows]     [Kernel Newbies]     [PHP Install]     [PHP Classes]     [Pear]     [Postgresql]     [Postgresql PHP]     [PHP on Windows]     [PHP Database Programming]     [PHP SOAP]

  Powered by Linux