You can use same concept with input textbox like
to disable the copy, paste, cut, right click and contextmenu in textbox.
I have used the events (oncopy, onpaste, oncut, oncontextmenu) of textbox to achieve the desired disability.
If you want to show the alerts then you have to modify the code like this
function disableCopy()
{
alert("You cannot perform Copy");
return false;
}
function disablePaste()
{
alert("You cannot perform Paste");
return false;
}
function disableCut()
{
alert("You cannot perform Cut");
return false;
}
function disableContextMenu()
{
alert("You cannot perform right click via mouse as well as keyboard");
return false;
}
0 comments:
Post a Comment