This question already has an answer here:
- How do I disable right click on my web page? 22 answers
I want to disable mouse right click on an HTML page. I have a page where user has to enter the details. I don't want the user to see the menu thats get displayed with the mouse right click. Rather I want to display a custom menu. I know there are some plugins available to do that. But my requirement does not need any plugins.
You can use the oncontextmenu event for doing this.
But if the user turns off javascript then you won't be able to handle this.
will disable right click menu.
There are plenty of examples of this which can be found via Google
However, users can turn off Javascript to stop this highly annoying "feature". I think you should really think about this before implementing it. It isn't really going to protect your content (if that is what you are trying achieve).
There is an article here that illustrates just how annoying and pointless it is.
You can do so with Javascript and/or an HTML attribute (which is really a Javascript event handler anyway) as described here: http://www.codeproject.com/KB/aspnet/Disabling_the_right_click.aspx
and
//Disable right click script via java script code
Click here to see semo