[jQuery] [autocomplete] append results to an input field
Hi,
Please can anyone suggest why the code is populating the wrong input
fields.
View page at:
http://www.batemans-auctions.co.uk/new_site/absentee_form.php
Type '10' (or another number) into the first (top-left) input box
under the 'Lot No' title. Then tab, should populate the 'Description'
box (#descno1) but it's populating the three fields below!!
Can't figure this out,
Thanks in advance.
Matt
Code:
$(document).ready(function(){
$("#lotno1").autocomplete("../js/autocomplete.php", {
matchContains: true,
mustMatch: true,
max: 30,
extraParams: {
SaleNo: function() { return $("#salenumber").val(); }
}
});
function findValueCallback(event, data, formatted) {
$("<li>").html( !data ? "No match!" : "Selected: " +
formatted).appendTo("#descno1");
}
$("#lotno1").result(function(event, data, formatted) {
if (data)
$(this).parent().next().find("input").val(data[1]);
});
});
The result isn't appearing in #descno1