The following is a Js snippet tested in IE9, Firebox 10.0.2:
$(document).keydown(function (e) {
var doPrevent;
if (e.keyCode == 8) {
var d = e.srcElement || e.target;
if (d.tagName.toUpperCase() == 'INPUT' || d.tagName.toUpperCase() == 'TEXTAREA') {
doPrevent = d.readOnly || d.disabled;
}
else
doPrevent = true;
}
else
doPrevent = false;
if (doPrevent)
e.preventDefault();
}) ;
The code on how to determine the Backspace key can be passed
here.
I hope it will be helpful to your web development.