I have very simple html with jQuery and jQuery UI, I use the autocomplete function, as far as this is good, the problem is that I have an array with three values, each of which blocks something like:
Array
(
[0] => stdClass Object
(
[product_id] => 5
[product_number] => AGD-ACRBD001
[product_name] => Title 1
)
[1] => stdClass Object
(
[product_id] => 6
[product_number] => AGD-ACRBD002
[product_name] => Title 6
)
[2] => stdClass Object
(
[product_id] => 7
[product_number] => AGD-ACRBD003
[product_name] => Title 34
)
)
So this is my array, with this array I only need the number [product_number] to build my array for automatic completion, which is NOT a problem, the problem is how to use other values when [product_number] was selected? ... HTML as follows:
<form>
<input type="text" id="ids" name="ids" placeholder="Product ID">
<input type="text" id="codes" name="codes" placeholder="Code">
<input type="text" id="names" name="names" placeholder="Names">
</form>
, - id = "", , [product_number], ... , id = "ids" id = "names" ... jQuery :
(function($) {
$(function() {
var availableTags = [
"AGD-ACRBD001",
"AGD-ACRBD002",
"AGD-ACRBD003"
];
$("#codes").autocomplete({
source: availableTags
});
});
})(jQuery);