When user navigates to some pages and when he clicks on back button, data is going to be sumitted again and it requires data to be submitted. It displays a page asking to refresh. But our users dont want to see that page. Either i want to take out those buttons or disable them(which looks not possible) or I want to tell them atleast not to use back button when they click on that. Even for that, I'm not able to catch back button event in the browser. Any ideas?
You could go through the trouble of creating an application startup page that opens a new browser window that does not show the back/forward button...
But the user could still use the keyboard-equivalents to navigate (like alt<- and alt-> . You could then try valiantly to intercept these keystrokes and eat them in event handlers on every screen element...
But the user could still use right-clicks to go back and forward in their history, so you'd have to try to disable those events as well...
This kind of thing needs to be done server-side, not in the client. NEVER, ever, trust the client to keep your web app safe. You need to be looking into token synchronization, so that when a page is received a second time on the client, the server detects this, refuses to process the request, and asks the user to resubmit the request after resyncing itself with the flow of the client's state.
Thanks for your replies. I understand the problems of Client. Try to implement this in server side.. The problem is this is already existing application which I support.. Thought of not taking much pain by changing lot of server side code and wanted to implement client side technique. Looks like, client side code is not feasible. Thanks again for your valuable comments.
SCJA, SCJP, SCWCD, SCBCD, SCDJWS.
I promise I will be the best, most loyal friend ever! All for this tiny ad:
a bit of art, as a gift, the permaculture playing cards