<html>
<head><title>Practice</title>
<script language="javascript" type="text/javascript">
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;
}
</script>
</head>
<body>
Password:<input type="password" oncopy="return disableCopy();" onpaste="return disablePaste();" oncut="return disableCut();" oncontextmenu="return disableContextMenu();"/>
</body>
</html>
How to disable cut , copy and paste operation for password box with alert messages , such that on every operation that will be performed on password box it shows an alert prompt so that user will be notified he can't do cut ,copy and paste operation on passwords.I had gone through other examples which uses onCopy, onCut, onPaste events.I had written functions for this events, but these functions did'nt prompt me the alert message when it was run across all three browsers please provide me help for this situation ,such that it could run across all three browsers and it prompts me an alert when the onCopy, onCut,onPaste event occurs. All I need is when I copy or cut passwords from password field, I need an alert stating that password cannot be copied as the message.
Thanks Friends in advance for the help