By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
437,605 Members | 2,129 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 437,605 IT Pros & Developers. It's quick & easy.

Disable right click of mouse

P: n/a


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
Share this Question
Share on Google+
4 Replies


P: n/a
Some thing like this:
document.onmousedown = mousedown_handler

function mousedown_handler(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.getElementById) {

// Probably Netscape 6 and later
if (mouse_event.which == 3) {
alert(no_right_click)
return false
}
}
else if (document.layers) {

// Probably Netscape 4
if (mouse_event.which == 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

P: n/a
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

P: n/a
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

P: n/a
On Thu, 07 Sep 2006 22:23:03 +1000, RobG <rg***@iinet.net.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 discussion thread is closed

Replies have been disabled for this discussion.