title: Stop 'Enter' key from working while search input field is empty
body: <p>I'm using some code (see below) that stops the search button on my site from working until some text has been entered into the search input field. This works great, however, before any text has been entered I'm still able to hit 'Enter' on the keyboard and it triggers a 'blank' search – is there also a way to disable the 'Enter' key until some text has been entered?</p>
  
  <pre><code>  &lt;div class="standard-search-box"&gt;
      &lt;form class="search-form" action="/search"&gt;
          &lt;label for="q" id="search-label" class="screen-reader-text"&gt;Search&lt;/label&gt;
          &lt;input aria-labelledby="search-label" id="q" type="search" name="q" class="search-field" placeholder="enter search term…" value autocomplete="off" autocorrect="off" autocapitalize="off" spellcheck="false"&gt;
          &lt;input type="submit" value="Search" class="search-button" disabled="disabled"&gt;
      &lt;/form&gt;
    &lt;/div&gt;
  
  
    (function() {
      $('input.search-field').keyup(function() {
  
        var empty = false;
        $('input.search-field').each(function() {
          if ($(this).val() == '') {
            empty = true;
          }
        });
  
        if (empty) {
          $('input[type=submit]').attr('disabled', 'disabled');
        } else {
          $('input[type=submit]').removeAttr('disabled');
        }
      });
    })();
  </code></pre>
  
  <p>Any help would be much appreciated.</p>