title: how to make auto complete display result from label or id
body: <p>I work on php sales program</p>
  
  <p>I have an input to select product from <code>autocomplete</code> list</p>
  
  <p>I simply want to display search results for the product I entered with the <code>product name</code> or whith the <code>product barcode</code> without displaying the barcode</p>
  
  <p>my php code for the source array is:</p>
  
  <pre><code>$source = array();
  $data = mysql_query("select * from items");
  while($d = mysql_fetch_assoc($data))
  {
      $array[id] = $d['id'];
      $array[value] = $d['product_name'];
      $array[lable] = $d['product_barcode'];
      array_push($source,$array);
  }
  $array = json_encode($source);
  </code></pre>
  
  <p>my js code is:</p>
  
  <pre><code>$('#main_item').autocomplete({
        source: &lt;?=$array?&gt;,
        select: function(event, ui) {
              $('.pur_items_id').last().val(ui.item.id);
              $('.item_name').text(ui.item.value);
         }
  });
  </code></pre>
  
  <p>what I need is , when <code>barcode</code> is entered autocomplete shows product with that barcode
  without displaying the barcode in autocomplete search results.</p>