title: jQuery UI autocomplete with JSON
body: <p>Alright been racking my brain on this (im terrible at this) but yea ive tried reading all i can and still cant get it to work.</p>
  
  <p>trying to do autocomplete with jquery ui</p>
  
  <p>my json looks like this</p>
  
  <pre><code>{"dealers":
       {
           "1156":"dealer 1",
           "1122":"dealer 2",
           "1176":"dealer 3",
           "1491":"dealer 4",
           "1463":"dealer 5",
           "269":"dealer 6"
      }
  }
  </code></pre>
  
  <p>i am trying to use this information as the source for autocomplete.  i am getting the response object just fine I am just having trouble getting it in the right format so that I can place the "###" in a hidden field tied to the "value" which needs to be displayed as the portion of the drop down.</p>
  
  <p>been trying a million different ways but a recent attempt was below</p>
  
  <pre><code>function ajaxCall() {
      $.getJSON("/example/location/example.json?term=" + $('#dealerName').val(),
          function(data) {
          $.each(data.dealers, function(k, v) {                
                  alert(k + ' : ' + v);
          });
      });        
  }
  
  $('#dealerName').autocomplete({
      source: ajaxCall,
      minLength: 2,
      delay: 100
  });
  </code></pre>
  
  <p>Please and thank you much!</p>