Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Mike Lewis on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Disable certain keys in browsers (reload, backspace, ...)

Status
Not open for further replies.

Telek

Programmer
Jul 29, 2002
2
0
0
CA
Can someone please tell me how to disable certain keystrokes (i.e. backspace, ctrl-R, ctrl-F5) in the browser? I have no idea if this can be done, and I don't want to disable things like alt-f4 or anything, so that's not an issue :)

The problem that I am having is that we have an application where if the user can use the back-button or the backspace button or even reload then the server will get confusing messages / the state will get screwed up. Consider this as just one example:

user submits a form containing a reply to a message (for something like a forum) to the server, the server returns them the new page with the updated message list. If the user tries to reload, then the message will be posted again. Similarly if the user hits the back button and returns to the previous page prior to the message being posted then they might be able to post a second reply. What if this is not permissable?

I know that some of this can be avoided by using a redirect, however there are several other examples in our web app where this sort of behaviour is undesirable. Is there anything that can be done?

Thanks a lot for your help.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top