title: jQuery Autocomplete options based on other Autocomplete input
body: <p>I want a user to select a company and then an employee from this company. I saw similar questions, the most similar is <a href="https://stackoverflow.com/questions/31300396/jquery-autocomplete-source-dependent-from-different-input">this</a> but I want both inputs to be autocomplete. </p>
  
  <p>I have following code:</p>
  
  <pre><code>&lt;div class="ui-widget"&gt;
     &lt;label&gt;Company&lt;/label&gt;
     &lt;input type="text" id="company"&gt;
     &lt;label&gt;Employee&lt;/label&gt;
     &lt;input type="text" id="employee"&gt;
  &lt;/div&gt;
  </code></pre>
  
  <pre><code>$(function() {
  
      var sources = {
          "Company ABC": [ "Employee 1", "Employee 2", "Employee 3" ],
          "Company CDE": [ "Employee 4", "Employee 5", "Employee 6" ],
          "Company EFG": [ "Employee 7", "Employee 8", "Employee 9" ],
          "Company GHI": [ "Employee 10", "Employee 11", "Employee 12" ]
      }
  
        $("#company").autocomplete({
          source: Object.keys(sources)
        });
  
        $("#employee").autocomplete({
          source: object values from selected object key ????
        })
  }) 
  </code></pre>
  
  <p>I spent hours on this and I have no idea how to write it. Any help would be appreciated. </p>