The below code is to disable the ctrl+s functionality and triger to user defined function when we press ctrl+s...It is working fine in IE. In mozilla also its working fine but the problem here is, letter "S" is diabled when i want to add any word which is including "S" is not posiible in mozilla.
can any one please help on this.
can any one please help on this.
Code:
document.onkeydown = disablekey;
document.onhelp=processHelp;
function disablekey(evtArg)
{
var isIE = ( document.all ? true : false) ;
var KeyID=( document.all ? window.event.keyCode : evtArg.which) ;
var ctrlPressed =( document.all ? window.event.ctrlKey: evtArg.which);
if ( ctrlPressed && KeyID == 83 )
{
if( isIE )
{
handleKey(evtArg);
event.keyCode = 0;
return false;
}
else
{
handleKey(evtArg);
evtArg.preventDefault();
evtArg.stopPropagation();
}
}
else
{
handleKey(evtArg);
}
}
function handleKey(evtArg)
{
var evt = ( document.all ? window.event : evtArg) ;
var isIE = ( document.all ? true : false) ;
var KeyID=( document.all ? window.event.keyCode : evtArg.which) ;
var skip=false;
ctrlPressed = evt.ctrlKey;
//var ctrlPressed =( document.all ? window.event.ctrlKey: evtArg.which);
if( ctrlPressed && KeyID == 83 )
{
if(document.MAINFORM.activity.value=="CREATE_ORDER_CONFIRMATION")
{
completeCreateOrderConfirmation();
if(!skip)
{
if ( isIE )
{
event.keyCode = 0;
event.returnValue = false;
return false;
}
else
{
evt.preventDefault();
evt.stopPropagation();
}
}
}
}
function processHelp()
{
return false;
}
Comment