title: jQuery UI Autocomplete - Disable selected option after select
body: <p>I've a jQuery UI autocomplete dropdown, I want to select one of the options, after that selection selected option'll be disabled/hidden. For example: I have {"good","better","best"} select "better", and autocomplete suggestion list will be {"good","best"}.</p>
  
  <p>Thanks in advance.</p>
  
  <p>Here detailed example (thanks to @Whitaker)</p>
  
  <pre><code>&lt;input id="myElement" /&gt;​
  var result; // should be array
  $("#myElement").autocomplete({
      source: function( request, response ) {
          $.ajax({
              type: "GET",
              dataType: "json",
              url: "autocomplete.php",
              data: {
                    startsWith: request.term
              },
              async:false,
              success: function( data ) {
                  result = data; // to do array assign process - not shown here
                  response($.ui.autocomplete.filter(result, request.term)); 
              }   
          }); 
      }, 
      select: function(event, ui) {  
          var index = $.inArray(ui.item.value, result); 
          result.splice(index, 1); 
      }
  });
  </code></pre>
  
  <p>jQuery ui splice() method works for static list, but I meet interesting point when debug the code that AJAX get method refresh result every click to input element. Is there any way that should work in client side? (without changing .php)</p>