title: jQuery - If "two blank spaces is inserted" do that
body: <p>I'm looking for a code that when user type two consecutive blank spaces, the autocomplete is turned off. Now, if the "#" isn't present, the autocomplete is turned off too. </p>
  
  <p><strong>This is my code:</strong></p>
  
  <pre><code>// "post-input" is text-area element
  var input = $("#post-input");
  
  if (input.val().search("#") === -1 ){
       var blankResult = [];
       input.autocomplete({
           source: blankResult 
       });
       input.attr('autocomplete','off');
  }
  </code></pre>
  
  <p>As you can see, this works, but now I want add the second "feature": if user type two blank spaces (consecutive), the autocomplete will be disabled. I can do something like <code>input.val().search("#") === -1 || input.val().search(" ") === 2</code>? </p>
  
  <p>Note: I know that the upper code will never be true, but I mean do something like this line.  </p>