title: How to make an INPUT TYPE="IMAGE" not submit on Enter in WebKit?
body: <p>In a C#/ASP.NET application, I have a form that renders much like the following (plus a lot more, but this is what matters):</p>
  
  <pre><code>&lt;form method="post" action=""&gt;
  &lt;input type="image" name="ctl15" src="cancel.gif" style="border-width:0px;" /&gt;
      &lt;!-- Server side, the above input is a System.Web.UI.WebControls.ImageButton. --&gt;
  ...more extra fluff...
  &lt;input type="submit" name="Button1" value="Proceed" id="Button1" class="button"
      style="width:59px;" /&gt;
  &lt;/form&gt;
  </code></pre>
  
  <p>This form works just fine in Internet Explorer and Firefox, but fails in WebKit-based browsers (Safari and Chrome). The problem is that when the user presses Enter when in an input field, rather than using the mouse to click on the submit button, the image input is activated (which in this case corresponds to a cancel event, exactly the opposite of the "proceed" action that is natural given the UI in question).</p>
  
  <p>What I want to do is to, on an Enter keypress, activate the <code>&lt;input type="submit"&gt;</code> button <em>instead of</em> the <code>&lt;input type="image"&gt;</code>, without breaking submission by clicking the image. How can I do that? Preferably in a cross-browser manner so I don't need yet more special cases in the code.</p>
  
  <p>No jQuery solutions, please, since this application doesn't use it (and introducing a whole new library for such a "simple" thing is going to be a very hard sell) - stock JavaScript is perfectly fine, though. Obviously the best would be if it can be done in just HTML and CSS, but I have my doubts about the feasibility of that.</p>
  
  <p>In essence, this question seems to me to be sort of the exact opposite of <a href="https://stackoverflow.com/questions/477691/html-submitting-a-form-by-pressing-enter-without-a-submit-button">HTML: Submitting a form by pressing enter without a submit button</a>.</p>
  
  <p>Unfortunately, since the different parts of the UI are rendered by different classes and kept in separate .aspx files (specifically, the <code>&lt;input type="image"&gt;</code> is in one place, and the <code>&lt;input type="submit"&gt;</code> in quite another), reordering the elements in the generated HTML is not really a feasible solution either.</p>