title: Jquery Autocomplete selected id not getting saved
body: <p>I am trying to get the selected value from the jquery autocomplete for some reason I am not able to get the id.  I saw a solution here <a href="http://www.codeproject.com/Articles/152558/jQuery-UI-Autocomplete-with-ID" rel="nofollow">http://www.codeproject.com/Articles/152558/jQuery-UI-Autocomplete-with-ID</a> but my data returns like below  How should I get the id saved?</p>
  
  <p><strong>My data</strong></p>
  
  <pre><code>[{"id":3,"homename":"DCosta"}]
  </code></pre>
  
  <p><strong>My code</strong></p>
  
  <pre><code>$("#lastname").autocomplete({
       source: function (request, response) {
       var term = request.term;
       if (term in cache) {
           response(cache[term]);
          return;
       }
        $.ajax({
          type: 'POST',
          url: someurl,
          dataType: 'json',
          data: { "Name": request.term},
          success: function (result) {
                var Surnames = JSON.parse(result.data);
                cache[term] = ($.map(Surnames, function (item) {
                 return {
                            label: item.homename,
                            //value: item.id  //&lt;== if I do like this the id show in the text box which I do now want
                            value: item.homename //&lt;== this shows correctly but the id is not accessable
                         }
                   }));
               response(cache[term]);
           },
  
           error: function (a, b, c) {
                         debugger;
           }
        });
  
        },
          select: function (event, ui) {
           self.Surname(ui.item.value); // save selected value
            console.log(self.Surname());  // shows ID if value: item.id or just the name
  
       },
             minLength: 2
  });
  </code></pre>