Shelane,

>Ability to show a subset of returned data (within each "record") and hide
>the rest.  On select, pick the data apart to put in different hidden
>fields.

My version already does this (as you may already know.)

See:
http://www.pengoworks.com/workshop/jquery/autocomplete.htm

Look at the "Ajax City Autocomplete" example.

$("#CityAjax").autocomplete(
        "autocomplete_ajax.cfm",
        {
                delay:10,
                minChars:2,
                matchSubset:1,
                matchContains:1,
                cacheLength:10,
                onItemSelect:selectItem,
                onFindValue:findValue,
                formatItem:formatItem,
                autoFill:true
        }
);

In the settings mapping, the key things to do this are the following:

onItemSelect:selectItem 
        - This says call the selectItem() function when an item is selected

onFindValue:findValue,
        - This is the custom function to use when finding a value. The
findValue() method will look in the text input element and then look to see
if the value is in the cache, if not it will go look it up via AJAX. It'll
return a <li /> element with the match, or null if it doesn't exist. You can
then look in the "extra" custom attribute to get to all your additional
values. 

formatItem:formatItem,
        - This defined how the <li /> should be displayed. 

If you look at the source code in my example, you should be able to get the
exact functionality you want.

-Dan

Reply via email to