Support Article
Block browser back button and right Click on Portal.
SA-10799
Summary
Procedure to stop the user to go back screen using IE back button or through right click context menu.
Steps to Reproduce
Use IE back button or "Back" option in right click context menu to navigate to the previous screen of the work flow and then click Submit in the screen.
Resolution
This issue is resolved through the following local-change:
Pass this javascript function in the Portal Harness to block it on some specific portal or copy the following code in UserWorkForm HTML Fragment if you are planning to stop this on the entire application:
var message="Function Disabled!";
function clickIE4(){
if (event.button==2){
alert(message);
return false;
}
}
function clickNS4(e){
if (document.layers||document.getElementById&&!document.all){
if (e.which==2||e.which==3){
alert(message);
pega.util.Event.stopEvent(event);
return false;
}
}
}
if (document.layers){
document.captureEvents(Event.MOUSEDOWN);
document.onmousedown=clickNS4;
}
else if (document.all&&!document.getElementById){
document.onmousedown=clickIE4;
}
document.oncontextmenu=new Function("alert(message);return false")
Published July 9, 2015 - Updated October 8, 2020
Have a question? Get answers now.
Visit the Collaboration Center to ask questions, engage in discussions, share ideas, and help others.