title: jQuery UI Autocomplete JSON array
body: <p>I have the following json array:</p>
  
  <pre><code>partTags = [{"part":"Part1","dwg":"A"},{"part":"Part2","dwg":"B"}]
  </code></pre>
  
  <p>Which basically carries the Part Number and a corresponding Drawing Number/Letter</p>
  
  <p>Prior to adding a second parameter ( "Drawing Number ") I just had the part number and I used jQuery autocomplete to search the array. What I want to do now is to Search for the part number in my first input:   <code>&lt;input type="text" id="part_number"&gt;</code> and automatically add its corresponding Drawing Number to a second input:  <code>&lt;input type="text" id="drawing_number"&gt;</code> upon clicking the part number.</p>
  
  <p>Here is what I had:</p>
  
  <pre><code>$( "#part_number" ).autocomplete({
     delay: 100,
     source: partTags
  }); 
  </code></pre>
  
  <p>How can I modify the code above to achieve this? I don't work much with jQuery so I'm quite lost when it comes to some of the API.</p>
  
  <p>Here's what I have so far after fiddling a bit...</p>
  
  <pre><code>$( "#part_number" ).autocomplete({
       delay: 45,
      source: partTags,
      select: function(event, ui)
      {
          $(this).val(ui.item.part);
          $("input#drawing_number").val(ui.item.dwg); 
          return false;
      }
  });
  </code></pre>