title: i cant hide jquery autocomplete with my functions
body: <p>I am creating project which it searches musics dynamicly with JSON.
  <br> Here is my html:</p>
  
  <pre><code>    &lt;div id="custom-search-input"&gt;
          &lt;div class="input-group col-md-12"&gt;
              &lt;input type="text" class="form-control input-lg" placeholder="Search query..." id="searchquery" autocomplete="off" /&gt;
              &lt;span class="input-group-btn"&gt;
                  &lt;button class="btn btn-info btn-lg" type="button" id="searchbuttonheader" onclick="search();"&gt;
                      &lt;i class="glyphicon glyphicon-search"&gt;&lt;/i&gt;
                  &lt;/button&gt;
              &lt;/span&gt;
          &lt;/div&gt;
      &lt;/div&gt;
  </code></pre>
  
  <p>My search function called <strong>search();</strong> ... Before I integrated jquery autocomplete I made when I click ENTER on keyboard in <strong>searchquery</strong> input it executes <strong>search();</strong> function. To do this here is my JS code:</p>
  
  <pre><code>    // ENTER KEY SEARCH //
  $.fn.enterKey = function (fnc) {return this.each(function () {$(this).keypress(function (ev) {
  var keycode = (ev.keyCode ? ev.keyCode : ev.which);
  if (keycode == '13') {search();}})})
  }
  $("#searchquery").enterKey(function () {search();});
      // ENTER KEY SEARCH //
  </code></pre>
  
  <p>OKAY ITS WORKING... BUT...</p>
  
  <p>After integration the jquery autocomplete when I type something in <strong>searchquery</strong> input it gives some autocomplete data. Here is JS:</p>
  
  <pre><code>$('#searchquery').autoComplete({
      minChars: 1,
      delay: 500,
      source: function(term, response){
          $.getJSON('&lt;?php echo $url_autocomplete; ?&gt;', { query: term }, function(data){ response(data); });
      },
      onSelect: function(e, term, item){
          search();
          //alert('Item selected by '+(e.type == 'keydown' ? 'pressing enter' : 'mouse click')+'.');
      }
  });
  </code></pre>
  
  <p>When I click one of them the autocomplete hides and searches the text. But when I don't select any of them and hit enter it searches but the autocomplete is not hiding. </p>
  
  <p>I WANT:
  When I type something in <strong>searchquery</strong> input then I hit enter hide autocomplete suggestions and make <strong>search();</strong>. </p>