This example displays an alert only when the pressed key should not be allowed in the textbox. However, in contrast to Example 3, the Backspace and Enter keys no longer fire the alert.