non è proprio quello che cerchi


<form action="" method="POST" id="form01" >
<input type="text" name="myText" onKeyPress="pippo()">

<script type="text/javascript" language="JavaScript">

function pippo() {
if (event.keyCode == 13) {
alert("hola mittler, hai premuto il tasto invio");
}
}

</script>
</form>