I have a form with two buttons, one input[type=submit]
and one plain button
which is the cancel button.
I have two event handlers, one bound to the form
on submit
and one bound to the button
on click
.
When I submit the form by pressing enter in an input the click event on the button fires (and before the submit event I might add), why is this?
This happens in both gecko and webkit.
Here's a working example: http://jsfiddle.net/q3JPR/
If you submit by pressing enter I want the submit event to trigger, not the click event.