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 backin
$(document).keydown(function(e) { var elid = $(document.activeElement).is('input'); if (e.keyCode === 8 && !elid) { return false; } });
Hope this might help you