title: jqueryui autocomplete filter results (from remote datasource ) that "begin with" input
body: <p>I'm using <a href="http://jqueryui.com/autocomplete/#multiple-remote" rel="nofollow noreferrer">jquery autocomplete with multiple results and a remote datasource</a>. I'm able to pull the data remotely and select multiple results. <strong>But the results list doesn't update based on the first 2 characters input, and the jQueryUI documentation is thin on this issue.</strong></p>
  
  <p>I've researched around, and found <a href="https://stackoverflow.com/a/2405109/1104878">this answer</a> here on SO and want to integrate it with the rest of my function, but it doesn't update the results list. Independently, the SO answer works fine, but not when integrated with multiple results and a remote datasource.</p>
  
  <p><strong>From the autocomplete/remote source/multiple function (truncated).</strong> This part works fine:</p>
  
  <pre><code>.autocomplete({
                  source: function( request, response ) {                            
                       $.ajax({
                          url: "/controller/myfunction",
                          dataType: "json",
                          data: request,
                          success: function(data){
                          if(data.response == 'true') {
                              response(data.message);
                              }
                          }
                      });
                  },
  </code></pre>
  
  <p><strong><a href="https://stackoverflow.com/a/2405109/1104878">Possible solution</a> on SO:</strong> (works fine independently, but not with the jquery/remote/multiple code):     </p>
  
  <pre><code>var wordlist= [ "about", "above", "within", "without"];
  
  $("#input1").autocomplete({
      source: function(req, responseFn) {
          var re = $.ui.autocomplete.escapeRegex(req.term);
          var matcher = new RegExp( "^" + re, "i" );
          var a = $.grep( wordlist, function(item,index){
              return matcher.test(item);
          });
          responseFn( a );
      }
  });
  </code></pre>
  
  <p>I need to integrate this solution with my code.</p>