In lot of projects we want to disable right click or we want to put some message to the user on right click on form or any specified control. so to achive this i have searched lot of code on net i found lot of solutions and from that i have made my code, i hope it will help you
(Optional) Is there any background to this article that may be useful such as an introduction to the basic ideas presented?
i have code below for displaying message on right click and also do nothing on right click. its simple.
function OnRightClick() {
if (event.button==2) {
alert('Hooray.... you are not view this source');
}
}
document.onmousedown=OnRightClick
if you dont want any message on right click set the oncontextmenu="return false" <body oncontextmenu="return false"> </body>
| You must Sign In to use this message board. | ||||||
|
||||||