<form onsubmit="return mySubmitFunction(event)"> ... </form> function mySubmitFunction(e) { e.preventDefault(); someBug(); return false; }