| Author |
disabling backspace for the browser
|
urvi patel
Greenhorn
Joined: May 30, 2003
Posts: 17
|
|
i an application for taking online examination using jsp and orcle, the person taking the exam gets questions on different pages.After he has answered one question he cannot come back to the previous question.for that the backspace key needs to be disabled.please help me in getting this thing done. send me the detailed code... Thanking you.... urvi
|
 |
Chris Baron
Ranch Hand
Joined: Mar 21, 2003
Posts: 1049
|
|
location.replace()disables browser-back-button, back in contextmenu and backspace as it overwrites the actual entry in the browsers history. Maybe there's a better way ( e.g. waiting 4 Eric Pascarello ), but here is an example that might help you: cb
|
 |
Devesh H Rao
Ranch Hand
Joined: Feb 09, 2002
Posts: 687
|
|
Hi i use this function hope it helps.. document.onkeydown = mykeyhandler; function mykeyhandler() { if (window.event && window.event.keyCode == 8) { // try to cancel the backspace window.event.cancelBubble = true; window.event.returnValue = false; return false; } }
|
 |
Gary McGath
Ranch Hand
Joined: Mar 15, 2003
Posts: 52
|
|
Even if you disable the backspace key, that won't solve your problem. There are too many ways to navigate back to a previous page, and in many browsers hitting backspace isn't even one of them. (The truth is, I didn't know there were any browsers in which backspace does that!) There are several ways in JSP to prevent earlier information from being shown again. One is to have a session variable that controls which question is being presented, and is incremented each time an answer is submitted. Since all the questions are being presented in the same page, and the URL doesn't change, browser navigation functions won't allow going back to an earlier question. This won't stop them from starting all over with a clean slate. You'll need to keep some kind of persistent record on each person to monitor that.
|
http://www.mcgath.com/consulting/
|
 |
urvi patel
Greenhorn
Joined: May 30, 2003
Posts: 17
|
|
Thanks For ur. answeres... urvi
|
 |
 |
|
|
subject: disabling backspace for the browser
|
|
|