The onBlur event handler is fired when the focus is moved away from that particular submit button.
<html>
<head>
<script language="JavaScript">
<!--
var counter = 0;
function comeBack(){
document.myForm.mySubmit.focus();
document.myForm.counter.value = counter++;
}
-->
</script>
</head>
<body onLoad='comeBack()'>
<form name="myForm">
<input type=TEXT value="Text Box" name="myText">
<input type=SUBMIT value="Submit" name="mySubmit" onBlur='comeBack()'><br>
<input type=TEXT size=2 value="" name="counter">
</form>
</body>
</html>