You can disable the combination of ctrl+v
and right click
.
for IE, you can use;
onpaste="return false;" oncut="return false;" oncontextmenu="return false;" oncopy="return false;".
Here is a workaround for all browsers;
function noCTRL(e) { var code = (document.all) ? event.keyCode:e.which; var ctrl = (document.all) ? event.ctrlKey:e.modifiers & Event.CONTROL_MASK; var msg = "Sorry, this functionality is disabled."; if (document.all) { if (ctrl && code==86) //CTRL+V { alert(msg); window.event.returnValue = false; } else if (ctrl && code==67) //CTRL+C (Copy) { alert(msg); window.event.returnValue = false; } } else { if (ctrl==2) //CTRL key { alert(msg); return false; } } } Email :<input name="email" type="text" value=""/><br/> Password :<input name="password" type="password" value=""/><br/> Confirm Email :<input name="email" type="text" value="" onkeydown="return noCTRL(event)"/> Confirm Password :<input name="password" type="password" value="" onkeydown="return noCTRL(event)"/>
and I donโt think the user can copy the password fields if the input type is password
Hope this helps.
Note: 1. Disabling JavaScript in the browser will allow the user to do whatever they want 2. Always respect the freedom of users. Keep it in your mind
source share