title: jQuery UI Autocomplete Multiple Values in Textbox
body: <p>I need a simple autocomplete search functionality but also allowing users to type more than one value. I'm using jQuery UI's autocomplete widget (<a href="http://jqueryui.com/autocomplete/" rel="noreferrer">http://jqueryui.com/autocomplete/</a>) and so far I've set the source to only search for the first letter in the suggestions. What I'd like to add now is the ability for users to search for multiple items from the same textbox. <em>(i.e. after a comma suggestions are shown again)</em></p>
  
  <p>I have been trying to search on how this could be done. The only thing I've managed to find is an option that could be added <code>multiple: true</code> (<a href="http://forum.jquery.com/topic/multiple-values-with-autocomplete" rel="noreferrer">http://forum.jquery.com/topic/multiple-values-with-autocomplete</a>). Thing is that it's not even listed in the documentation anymore so I don't know if the option has changed or doesn't exist anymore.</p>
  
  <p>This is my code:</p>
  
  <pre><code>    var items = [ 'France', 'Italy', 'Malta', 'England', 
          'Australia', 'Spain', 'Scotland' ];
  
      $(document).ready(function () {
          $('#search').autocomplete({
              source: function (req, responseFn) {
                  var re = $.ui.autocomplete.escapeRegex(req.term);
                  var matcher = new RegExp('^' + re, 'i');
                  var a = $.grep(items, function (item, index) {
                      return matcher.test(item);
                  });
                  responseFn(a);
              }
          });
      });
  </code></pre>
  
  <p>What I tried:</p>
  
  <pre><code>    var items = [ 'France', 'Italy', 'Malta', 'England', 
          'Australia', 'Spain', 'Scotland' ];
  
      $(document).ready(function () {
          $('#search').autocomplete({
              source: function (req, responseFn) {
                  var re = $.ui.autocomplete.escapeRegex(req.term);
                  var matcher = new RegExp('^' + re, 'i');
                  var a = $.grep(items, function (item, index) {
                      return matcher.test(item);
                  });
                  responseFn(a);
              },
              multiple: true
          });
      });
  </code></pre>