title: jQuery UI Autocomplete on keyup?
body: <p>I'm working with the jQuery UI library's <a href="http://jqueryui.com/demos/autocomplete/" rel="nofollow">autocomplete</a> functionality. I have two form fields on a webpage - one is internal search, and one searches content my company manages on a third party site via a REST API.</p>
  
  <p>This works as it should - if I have the two form fields sitting next to each other, I can type into either and get the autocomplete results for that datasource below.</p>
  
  <p>What I've been asked to do, though, is combine the two fields into one "master" search field and hide the two individual fields. It would search <em>both</em> data sources for the user's input, and display the results in separate ui-autocomplete boxes below the field.</p>
  
  <p>My idea is that if I could just change the trigger method for autocomplete from "focus" to "keyup" it would work very nicely, or if I could "fake" the focus trigger without sending the cursor to the hidden field.</p>
  
  <p>Any ideas on this?</p>
  
  <p><strong>Update:</strong></p>
  
  <p>Here's the code I've been trying, and it doesn't work. This is what lead me to think I was dependent on the focus event.</p>
  
  <pre><code>$(function(){
  // run autocomplete on form fields
  searchAutocomplete('/support/results_json/','#keywords');
  searchAutocomplete('/support/zdresults_json/','#zd_search');
  //$('#ee_searchform').hide(); // will need this later
  //$('#zd_searchform').hide(); // will need this later
  $('&lt;form id="support_search" class="group" method=""&gt;&lt;fieldset&gt;&lt;legend&gt;Search Support&lt;/legend&gt;&lt;ol&gt;&lt;li&gt;&lt;label for="support_keywords"&gt;Keywords&lt;/label&gt;&lt;input type="search" value="" name="support_keywords" id="support_keywords" /&gt;&lt;/li&gt;&lt;li class="submit"&gt;&lt;input type="submit" name="support_submit" id="support_submit" value="Search" /&gt;&lt;/li&gt;&lt;/ol&gt;&lt;/form&gt;').insertAfter('#zd_searchform');
  
  $('#support_keywords').keyup(function() {
    var value = $('#support_keywords').val();
      $('#keywords').val(value);
      $('#keywords').keyup();
  }); 
  });
  </code></pre>
  
  <p>So you can see, I take the two form fields that the HTML contains, and make sure they call the working autocomplete function. Then I use jQuery to add another form to the DOM, and when it gets a keyup it adds its contents to one of the other fields, and gives that field a keyup. This doesn't call the autocomplete, though.</p>
  
  <p>Many thanks.</p>