This example will display an alert only if the key that is pressed should not be allowed in the textbox. But this time, the Backspace and Enter keys will not display an invalid character alert.