Board Thread:Support Requests - Getting Technical/@comment-24475667-20140611185607/@comment-452-20140611235926

You should instead detect when the form is submitted, because pressing "enter" in the Edit Summary can submit the form, and there is a second submit button in the preview modal.

I use $("form#editform").bind("submit", function( event ) { //detect any stupid mistakes I've made

//How to stop form from submitting: event.preventDefault; event.stopImmediatePropagation;

//How to auto-click the diff link: $("a#wpDiff").click; });   var events = $._data($("form#editform")[0], 'events').submit;    events.unshift(events.pop); The last part switches the order of the events, so your function is fired before the form is submitted.

You'll obviously want to add some conditional logic in there, because as-is, you'd never be able to submit an edit with this code.

Please be aware that popping up an alert box on submit may violate the customization policy.