Mozilla firefox issue with keyboard events

Mozilla firefox issue with keyboard events

Yesterday, I posted this and was told that I should use event.which instead of event.keyCode for keyboard events, and that was good. But even after switching to using 'which', there is still an issue, and it is only with Mozilla Firefox 38.0.1 -- the backspace key isn't working.

If you try the following code on IE, Chrome, and Opera, you will be able to type in letters and backspacing as well, but not with Mozilla Firefox:

<!DOCTYPE html>
<html>
<head>
<title></title>
<script src="//ajax.googleapis.com/ajax/libs/jquery/1.11.2/jquery.min.js"></script>
<script>
    $(function() {
        var sAllowableCharacters = "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz";
        $("#txtText").on({
            keypress: function(event) {
                var s = String.fromCharCode(event.which);
                if (sAllowableCharacters.indexOf(s) === -1) {
                    return false;
                }
            },
            keyup : function(event) {
                var sInput = $("#txtText").val().trim();
                console.log("sInput=" + sInput);
            }
        });
    });

</script>
<style>
</style>
</head>
<body>   
    <label>Phone Number:&nbsp;<input id="txtText" /></label>
</body>
</html>

Normally the backspace is processed by the keypress event, can anyone tell me why it's not working and only for Mozilla Firefox?

Thanks.