function preventbackspace() {
//Only allow backspace for entry fields
if (typeof window.event != 'undefined') {
document.onkeydown = function() {
if (event.srcElement.tagName.toUpperCase() == 'INPUT' || event.srcElement.tagName.toUpperCase() == 'TEXTAREA'){
/*allow*/
}else {
return (event.keyCode != 8);
}
}
} else {
document.onkeypress = function(e) {
if (e.target.nodeName.toUpperCase() == 'INPUT' || e.target.nodeName.toUpperCase() == 'TEXTAREA') {
/*allow*/
}else{
return (e.keyCode != 8);
}
}
}
}