Disabling backspace key works in all browsers but IE
<p>I'm trying to disable the backspace button on an order page in all cases except when a textarea or text input is an active element to prevent users from accidentally backing out of an order.  I have it working fine in most browsers, but in IE (testing in IE9, both regular and compatibility mode) it still allows the user to hit the backspace and go to the previous page.</p>

<p>Here's the code:</p>

<pre><code>$(document).keypress(function(e){
        var activeNodeName=document.activeElement.nodeName;
        var activeElType=document.activeElement.type;
        if (e.keyCode==8 &amp;&amp; activeNodeName != 'INPUT' &amp;&amp; activeNodeName != 'TEXTAREA'){
            return false;
        } else {
            if (e.keyCode==8 &amp;&amp; activeNodeName=='INPUT' &amp;&amp; activeElType != 'TEXT' &amp;&amp; activeElType != 'text'){
                return false;
            }
        }
    });
</code></pre>

<p>Any advice on what I'm doing wrong here?</p>

<p>Thanks!</p>
