Например:
<form action="#" id="frm" onsubmit = "return showMessage()">
<input type="submit" value="Submit1" /><br/>
<input type="submit" value="Submit2" />
</form>
<script type="text/javascript">
function showMessage() {
alert ("1");
return true;
}
</script>
<script type="text/javascript">
document.getElementById("frm").parentNode.addEventListener("submit", function(e) { alert("Intercepted!"); }, true);
</script>