title: Display two values in the dropdown jquery autocomplete
body: <p>I am making a search feature using jQuery autocomplete where the data is coming from a json. 
  The search is supposed to display the full name of a person, but since the first name and last name are in two different fields in the json, I am finding it hard to display both the first name and last name together in the autocomplete dropdown.   </p>
  
  <p>Is it somehow possible to concatenate the two values together when one searches for either and display the full name in the dropdown ?</p>
  
  <p>Example of JSON:</p>
  
  <pre><code>{
      "GetContactsResult": [
      {
          "FirstName": "John",
          "LastName": "Doe",
          "LocalNumber": "555000",
          "MobileNumber": "555000"
              },
              {
                  "FirstName": "Jane",
                  "LastName": "Doe",
                  "LocalNumber": "555000",
                  "MobileNumber": "555000"
  
                      }]}
  </code></pre>
  
  <p>Here is my code/html:</p>
  
  <pre><code>        &lt;!DOCTYPE html&gt;
      &lt;html&gt;
      &lt;head&gt;
          &lt;link rel="stylesheet" href="//code.jquery.com/ui/1.11.4/themes/smoothness/jquery-ui.css"&gt;
          &lt;script src="http://code.jquery.com/jquery-2.1.0.min.js"&gt;&lt;/script&gt;
          &lt;script src="//code.jquery.com/ui/1.11.4/jquery-ui.js"&gt;&lt;/script&gt;
          &lt;script type="text/javascript"&gt;
  
  
  
          $(document).ready(function(){
              $("#typedText").autocomplete({
                  source: function ( request, response ) {
                      $.ajax({
                          url: "data.json",
                          dataType: "json",
                          success: function (data) {
                              var sData = data.GetContactsResult.filter(function(v) { 
                                  var re = new RegExp( request.term, "i" );
                                  return re.test(v.FirstName);
  
                              });
  
                              response( $.map( sData, function ( item ) {
                                  return {
                                      label: item.FirstName
                                  };
                              }));
                          }
                      });
                  },
                  minLength: 2,
              });
          });
  
          &lt;/script&gt;
          &lt;meta charset="utf-8"&gt;
          &lt;title&gt;click function&lt;/title&gt;
      &lt;/head&gt;
      &lt;body&gt;
          &lt;input  id="typedText"&gt;
          &lt;input type="button" id="getValue" value="Type value"&gt;
      &lt;/body&gt;
      &lt;/html&gt;
  </code></pre>
  
  <p>So just to make it more clear, I am trying to get "John Doe" being displayed in the autocomplete and not just  "John".</p>