title: prevent form submit from redirecting/refreshing using javascript
body: <p>I have a page where you can enter data within a series of texboxes (generated from php), and 2 buttons, GetData and SaveData. I want to be able to press enter when editing the texboxes, and it would perform the same action as clicking the SaveData button (onclick="onSave();"). I can acheive this by doing the following:</p>
  
  <pre><code>&lt;form id="editForm" name="editForm" action="onSave();"&gt;
  </code></pre>
  
  <p>but when I press enter, the page is redirected to the page, without the php post (ex.:www.mypage.com/index.php, instead of www.mypage.com/index.php?edit_data=true)</p>
  
  <p>How do I achieve what I want?</p>