473,777 Members | 1,732 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

Disable right click of mouse



This has probably been covered before but I can't seem to find it. I
want to disable the user from using the right mouse button that brings
up a windown menu of options. How's it done?????
Sep 6 '06 #1
4 2277
Some thing like this:
document.onmous edown = mousedown_handl er

function mousedown_handl er(event) {

event = (event) ? event : ((window.event) ? window.event null);
if (!event) {
return;
}
// This is the message that will appear
var no_right_click = "Sorry, right-clicking is not allowed!"

if (document.all) {

//Probably Internet Explorer 4 and later
if (event.button == 2 || event.button == 3) {
alert(no_right_ click)
return false
}
}
else if (document.getEl ementById) {

// Probably Netscape 6 and later
if (mouse_event.wh ich == 3) {
alert(no_right_ click)
return false
}
}
else if (document.layer s) {

// Probably Netscape 4
if (mouse_event.wh ich == 3) {
alert(no_right_ click)
return false
}
}
}

Seen wrote:
This has probably been covered before but I can't seem to find it. I
want to disable the user from using the right mouse button that brings
up a windown menu of options. How's it done?????
Sep 7 '06 #2
Seen wrote:
>
This has probably been covered before but I can't seem to find it. I
want to disable the user from using the right mouse button that brings
up a windown menu of options. How's it done?????
Poorly.
Sep 7 '06 #3
Seen wrote:
>
This has probably been covered before
Yes, hundreds of times and in the FAQ as well.

but I can't seem to find it.
Check the FAQ:
<URL: http://www.jibbering.com/faq/#FAQ4_27 >

Or the archives:
<URL:
http://groups.google.com.au/group/co...t=0&scoring=d&
>
I want to disable the user from using the right mouse button that
brings up a windown menu of options. How's it done?????
It isn't.
--
Rob
Sep 7 '06 #4
On Thu, 07 Sep 2006 22:23:03 +1000, RobG <rg***@iinet.ne t.auwrote:
>Seen wrote:
>>
This has probably been covered before

Yes, hundreds of times and in the FAQ as well.

>but I can't seem to find it.

Check the FAQ:
<URL: http://www.jibbering.com/faq/#FAQ4_27 >

Or the archives:
<URL:
http://groups.google.com.au/group/co...t=0&scoring=d&
>I want to disable the user from using the right mouse button that
brings up a windown menu of options. How's it done?????

It isn't.
Thanks you, didn't know where the FAQ's were

SR
Sep 8 '06 #5

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

4
9675
by: Lijun Yang | last post by:
Hey, I am able to disable the right mouse button on images for netscape and IE but it won't work for Opera. Here is the code: // start of the code var clickmessage="Sorry, you don't have permission to right-click." function protectImages () {
9
2876
by: Dennis Allen | last post by:
Hi. What's the best way to display an image, disabling the user's ability to right-click on it? I believe you have to use <body oncontextmenu="return false">. Would the following work? var x = "<head><\/head><body oncontextmenu="return false"><img src='temp.jpg' border=0><\/body>" top.document.open()
6
3168
by: nntp | last post by:
I have a set of links which I want search engines to crawl them, but I want to disable them from my visitors, so I will ask the link owners to pay me to let me enable them. <a disabled href="#">bahbahbah</a> Does not work, as it is still clickable. It only changes the color to grey.
4
2461
by: hon123456 | last post by:
Dear all, I want to disable the mouse's right click and the scroll bar. What is the javascript to do that? Thanks
2
8916
by: RootSpy2006 | last post by:
Hi All, Problem Definition: --------------------- Microsoft Wirelss Keyboard works in BIOS but does not work when booting into windows. Discovered Work-around: ----------------------------- 1.> Open Device Manager(The keyboard device will have an exclamation and
9
8058
by: Armando | last post by:
I have an app (A2000) where I am letting the user move an object on the screen. I use the OnClick for a command button event to modify the object's Top (or Left) properties, but you can only click slowly. That is, every other click is ignored, because Access is seeing a double click event. I would put the same code there, except I'm also using the SHIFT key (during mouse click) to cause bigger moves, and there's no SHIFT flag for the...
14
3774
by: Amar | last post by:
Hi All, I am a newbie to PHP and have the task to create a page using PHP where in that page I need to disable all key operation as well as mouse operation even also the menu operation that means printscreen. I have only the java script code for mouse right click disable but that does not allow me to disable to do ctrl+c. So I need some help that can solve my task. Waiting for your replies. Thanks,
8
3726
by: FAQ server | last post by:
----------------------------------------------------------------------- FAQ Topic - How do I disable the right mouse button? ----------------------------------------------------------------------- The oncontextmenu intrinsic event is the only safe and reliable method. Of the other approaches often presented, most depend on an alert box interrupting the process and rarely work. Note that oncontextmenu is a non-standard event and is not...
2
2367
by: mahesh123 | last post by:
Hi, I had a small problem regarding the Right click of the Mouse button. ie when the form as Border Style= Fixed style, Control Box = False. these are the properties set to the form. and the problem when we make the exe and run that form then click continously on the form at the task bar(right click) . then we find the pop menu with option close and minimise are enable and all are disable. Actual result is even though when we click...
0
10292
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers, it seems that the internal comparison operator "<=>" tries to promote arguments from unsigned to signed. This is as boiled down as I can make it. Here is my compilation command: g++-12 -std=c++20 -Wnarrowing bit_field.cpp Here is the code in...
0
9923
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each protocol has its own unique characteristics and advantages, but as a user who is planning to build a smart home system, I am a bit confused by the choice of these technologies. I'm particularly interested in Zigbee because I've heard it does some...
0
8954
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing, and deployment—without human intervention. Imagine an AI that can take a project description, break it down, write the code, debug it, and then launch it, all on its own.... Now, this would greatly impact the work of software developers. The idea...
1
7471
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new presenter, Adolph Dupré who will be discussing some powerful techniques for using class modules. He will explain when you may want to use classes instead of User Defined Types (UDT). For example, to manage the data in unbound forms. Adolph will...
0
6722
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and then checking html paragraph one by one. At the time of converting from word file to html my equations which are in the word document file was convert into image. Globals.ThisAddIn.Application.ActiveDocument.Select();...
0
5368
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The last exercise I practiced was to create a LAN-to-LAN VPN between two Pfsense firewalls, by using IPSEC protocols. I succeeded, with both firewalls in the same network. But I'm wondering if it's possible to do the same thing, with 2 Pfsense firewalls...
0
5497
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
1
4031
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated we have to send another system
2
3627
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.