>Using the AutoCompleter at http://bassistance.de/jquery-plugins/jquery-
>plugin-autocomplete,
>how do I process the data I'm sending back.
>
>The data comes back like this:
>
>Item | Item Description | Qty On Hand | Price
>
>I need to put Item Description, Qty On Hand, and Price in three SPAN
>elements.
>
>The code is below.  Go easy, I'm new to JQuery and I'm no JavaScript
>expert . . .
>
><script type="text/javascript">
>$(document).ready(function() {
>
>       $("#txtItem").autocomplete("itemquery.acm", {
>               minChars: 3,
>               delay: 150,
>               width: 400,
>               formatItem: formatItem,
>               formatResult: formatResult,
>               selectFirst: false,
>               extraParams: {
>                       CustNo: "436887"
>               }
>       });
>
>       $("#txtItem").result(function(event, data, formatted) {
>               $(this).find("..+/input").val(data[1]);
>       });
>
>});

As you can see, the selected data comes back as an array in the data
argument.

data[0] = Item
data[1] = Item Description
data[2] = Qty On Hand
data[3] = Price

-Dan

Reply via email to