title: Javascript alert box unnecessarily submits form
body: <p>I have a simple javascript method to show an alert box. The method is called when a button is clicked (which is between the form tags). The alert is supposed to simply display a help dialog, but when the user presses the "ok" button on the alert box it submits the form! I cannot figure out how to prevent this. I've tried changing how I make the button and my alert method, but nothing seems to make a difference. Here is my code:</p>
  
  <pre><code>&lt;script type="text/javascript"&gt;
  function help(){      
      alert("Displaying help...");
  }
  &lt;/script&gt;
  </code></pre>
  
  <p>Below is how I've created the button. I also tried creating the button with button tags, but the same problem occurred.</p>
  
  <pre><code>&lt;form action="./go.php" method="post"&gt;
  &lt;input type="image" src="./help.png" name="help" width="25" height="25" onclick="help()"&gt;
  .
  .
  .
  &lt;/form&gt;
  </code></pre>
  
  <p>Any help on how I can prevent the alert box from submitting the form is greatly appreciated. Thanks in Advance!</p>