Re: php / mysql / js search result question

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

 



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