title: jQuery keyup and 'enter' in Safari
body: <p>I am using jQuery and want to make it possible for the user to hit enter after entering data into a search field to start the search.</p>
  
  <p>I'm using the following code:</p>
  
  <pre><code>        $('#textSearch').keyup(function (event) {
              if (event.keyCode == '13') {
                  doSearch();
              }
              return false;
          });
  </code></pre>
  
  <p>It works perfect in Firefox and IE but not at all in Safari. What happens is that the form is being submitted when I hit enter in safari and that is not what I want. </p>
  
  <p>Adding onsubmit="return false;" to the form works but is not an option as the form tag is on a masterpage of an asp.net page and I need the form to be submitted on other pages.</p>
  
  <p>Is there a way to also get this feature working in Safari?</p>
  
  <p>EDIT:
  I also tried to just show an alert instead of the doSearch() function. The alert shows up fine but after that the form is being submitted.</p>