I have a javascript code to stop the backspace to go 'BACK'
my code:
when I add this code to a page use atlas the atlas dont work.Code:<script type="text/javascript"> if (typeof window.event == 'undefined'){ document.onkeypress = function(e){ var test_var=e.target.nodeName.toUpperCase(); if (e.target.type) var test_type=e.target.type.toUpperCase(); if ((test_var == 'INPUT' && test_type == 'TEXT') || test_var == 'TEXTAREA'){ return e.keyCode; }else if (e.keyCode == 8){ e.preventDefault(); } } }else{ document.onkeydown = function(){ var test_var=event.srcElement.tagName.toUpperCase(); if (event.srcElement.type) var test_type=event.srcElement.type.toUpperCase(); if ((test_var == 'INPUT' && test_type == 'TEXT') || test_var == 'TEXTAREA'){ return event.keyCode; }else if (event.keyCode == 8){ event.returnValue=false; } } } </script>
what the problem?
or there is any way to fix it.
thanks!




Reply With Quote