It would also work in more instances (e.g., if the user submits the form by actually clicking the submit button instead of pressing Enter).
However, if the tex field is checked onkeyup, the field will be validated before the user presses enter, or clicks the submit button:
<input type="text" ... onkeyup="this.value=this.value.replace(/?!/g,'')">
Of course, you'd add in all the punctuation, escaping \ some where necessary.