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]);
        });

});

function findValueCallback(event, data, formatted) {
        $("<li>").text( !data ? "No match!" : "Selected: " +
formatted).appendTo("#result");

// line above will go away - it is from the example code

// Old code, worked with an earlier version, this is what I want to
accomplish
//      oItmDesc = document.getElementById("ItmDesc");
//      oItmDesc.innerHTML = li.extra[0];
//      oOnHandQty = document.getElementById("OnHandQty");
//      oOnHandQty.innerHTML = li.extra[1]
//      oPrice = document.getElementById("Price");
//      oPrice.innerHTML = li.extra[2]

}

function formatItem(row) {
        return row[0] + " - " + row[1];
}

function formatResult(row) {
        return row[0];
}</script>

Reply via email to