I want to make a page (in this case view
) which will show error if backspace is pressed.
This is my attempt for the backspace key:
<script type ="text/javascript">
$(document).ready(function (event) {
if (event.keycode == 8) {
alert("Don't go back");
window.history.back(0);
}
});
</script>
Its not working,
Also,I want to get hold of the browser back button, so that i can disable going back page.
any alternative will be embraced as it will save my day.
Thanks in advance.