title: jQuery UI Autocomplete shows displays on a list the results but when select, prints the value and not the label
body: <p>I am having a lot of problems getting autocomplete working. First I've a validation incompatibility because I was using jQuery Validation and jQuery 1.5 and was breaking the AJAX functions on Autocomplete widget. This has been solved, now my PHP controller returns me a JSON of results with label/value. Of course, label is the name I want to show and the value is the value I need to submit.</p>
  
  <p>I am using an example JSON output with PHP, only for testing and not for searching right now. This is what I send back when I make the AJAX request:</p>
  
  <pre><code>[{"label":"Client example","value":1},{"label":"Lorem Ipsum","value":2},{"label":"Microsoft","value":3}]
  </code></pre>
  
  <p>And using the next code I supposed that will show me directly the label and submit the id. When I start typing I see the results I want in a list Client example, Lorem Ipsum and Microsoft but when I select on of them the list is closed and the input shows the value and not the label.</p>
  
  <pre><code>$("#clientid").autocomplete({
      source: function(request, response) {
          $("#ajax-loader").fadeIn('normal');
  
          $.ajax({
              url: BASE_URL + 'projects/ajax/get_clients',
              data: request,
              dataType: "json",
              type: "POST",
              success: function(data) {
                  response(data);
              }
          });
  
          $("#ajax-loader").fadeOut("normal");
      },
      minLength: 2
  });
  </code></pre>
  
  <p>I also tried a code that @3nigma suggested me when I was looking why was the autocomplete failing:</p>
  
  <pre><code>success: function(data) {
      response($.map( data, function( item ) {
          return {
              label: item.label,
              value: item.value
          }
      }));
  }
  </code></pre>
  
  <p>And nothing. Looking on examples of jQuery UI website and Google, seems that select has to do this thing so I tried:</p>
  
  <pre><code>select: function(event, ui) {
      $("#clientid").val(ui.item.label);
  }
  </code></pre>
  
  <p>But doesn't works too., I see the value on the <code>&lt;input /&gt;</code>.</p>
  
  <p>I don't know what more I can try. How I can solve this problem?</p>
  
  <p>Thank you in advance!</p>