function readOnly(count){ }
Starting November 20, the site will be set to read-only. On December 4, 2023,
forum discussions will move to the Trailblazer Community.
+ Start a Discussion
Naresh KukretiNaresh Kukreti 

Browser back press

Can anyone tell me how to prevent browser back press in visualforce pages

Thanks
bob_buzzardbob_buzzard
You can't stop the user pressing the browser back button, as that would allow nefarious javascript to trap people on web pages. There are some rather hacky workarounds documented at:

http://www.htmlgoodies.com/tutorials/buttons/article.php/3478911

but I'd be really wary of doing this. A better approach is to add an unload handler, which will ask the user to confirm that they wish to navigate awat from the page.