title: Javascript autocomplete with different input field value
body: <p>I have the following javascript that autocompletes based on a users display name. Problem is that the autocomplete input field is the display name. Each user actually has a user id, but I want to look up the user in the autocomplete based on the display name but when I submit the form I want to submit the user ID itself.</p>
  <pre><code>&lt;script&gt;
  
  $(document).ready(function() {
  $(&quot;input#autocomplete&quot;).autocomplete({
  
  source: [
  &quot;John Doe&quot;, 
  &quot;Another User&quot;, 
  
  ]
  
  });
  
  });
  
  &lt;/script&gt;
  
  &lt;input id=&quot;autocomplete&quot; name=&quot;autocomplete&quot;/&gt;
  </code></pre>
  <p>Can anyone suggest how i can do this? Ideally in the source, is there a way to have the user ID as the value too and somehow have the user ID submitted but with display name?</p>