[FX.php List] Search as you type

Dale Bengston dbengston at tds.net
Tue Oct 12 07:18:38 MDT 2010


Hi Stephe,

I tend to use a type-ahead in places where the user is doing what I call a "lazy" search. This means they have one field to type in, and it's technically searching in more than one field (even though I'm searching an array stored in a $_SESSION array). To create my session-stored list for a "lazy" search, I aggregate several fields.

For example, I have a client that's a wine distributor. Their "lazy" product lookup would pick from a session list that aggregates the vintage, winery and varietal fields, like this:

2008 Doña Paula Malbec
2009 Alamos Malbec
2009 Bogle Chardonnay
2009 Bogle Merlot
[...]

When the user makes a selection from the drop-down triggered by their typing, the selection triggers an ajax lookup of the full product details, which are displayed beneath the type-ahead input field. 

As mentioned earlier, I am using Scriptaculous, which in turn uses Prototype's ajax.autocompleter class. I don't want to start a flame war about what the best ajax framework is: take your pick among Scriptaculous, JQuery, Mootools, Tweener, etc.

Hope this helps,
Dale



On Oct 11, 2010, at 10:28 PM, Stephe Pocock wrote:

> Thanks Tim, Mike, Dale and Leo
> 
> Off to the drawing board I go, well w3schools anyway.
> 
> I was looking at ajax with an xml export, but the array easier to produce the list of contacts. 
> 
> My next question is if an array contains the values, in this case the names of the people, can it also contain their company, telephone and email (as a link)?
> 
> Maybe I am getting ahead of myself.  Let me go off and see if I can produce a searchable array :)
> 
> Thanks again
> 
> Stephe
> 
>  _______________________________________________
> FX.php_List mailing list
> FX.php_List at mail.iviking.org
> http://www.iviking.org/mailman/listinfo/fx.php_list

-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://mail.iviking.org/pipermail/fx.php_list/attachments/20101012/89386aee/attachment.html


More information about the FX.php_List mailing list