EDIT
This only works in FF and not in Chrome (and I, I think, not in other WebKit-based browsers), so I just leave it here as a browser, a workaround, an interesting note, but not as an answer.
@ An ideal suggestion NOT to make submit type cancel buttons is perhaps the cleanest way. However, if you SHOULD do it the way you do it now:
$('form').submit(function(e){ if(e.originalEvent.explicitOriginalTarget.id === 'cancel'){
source share