title: Prevent form submission on hitting Enter key for Text
body: <p>I know this question has been asked before but I could not find a satisfactory answer for my situation. So I am asking again. </p>
  
  <p>I have a simple form with 2 text boxes and a submit button. After the user enters text in either text box they should not be able to submit through the Enter key, only the submit button should allow them to submit. I thought trapping the enter keypress and returning false from the onChange event handler would do the trick but apparently not, this still causes a form submission...</p>
  
  <p></p>
  
  <pre><code>function doNotSubmit(element) {
  
          alert("I told you not to, why did you do it?");
          return false;
  
  }
  &lt;/script&gt;
  
  
  &lt;form id="myForm" action="MyBackEnd.aspx" method="post"&gt;
  
  &lt;table&gt;
      &lt;tbody&gt;
      &lt;tr&gt;
          &lt;td&gt;
            Joe:  &lt;input id="JoeText" type="text" onChange="doNotSubmit(this)"&gt;
          &lt;/td&gt;
          &lt;td&gt;
            Schmoe:  &lt;input id="SchmoeText" type="text" onChange="doNotSubmit(this)"  &gt;
          &lt;/td&gt;
      &lt;/tr&gt;
      &lt;/tbody&gt;
  &lt;/table&gt;
  
  &lt;input type=submit&gt;
  </code></pre>
  
  <p></p>
  
  <p>I tested on both Chrome and FF (latest versions).</p>
  
  <p>Can you please show me how to prevent the form submission?</p>
  
  <p>Thanks.</p>