CodeWidgets.com: Online Source Code Library: C#, ASP, ASP.NET, VB, VB.NET, VB Script, Microsoft Access, Excel, JavaScript, J Script, XML, VBScript, Website Design, DevExpress Components, Reporting, Application and Website Templates.

Widget #CS0083

Disable Right Click in Browser Window. (Javascript)

Free

Use Javascript to disable the users ability to display a popup menu after right clicking in browser window.
Left click on document is accepted, Right click is disabled.

Right Click this page for demo!!

<script language="javascript">
document.addEventListener('contextmenu', event => event.preventDefault());
document.onmousedown=disableclick;
function disableclick(e) {
if( event.button==2 )
alert("Sorry Right Click has been disabled!");
return false;
}
</script>

Last Updated: 4/9/2018


Related Widgets 
Price 
# 
CS0040 Add Sounds to button events. ASP.NET$0.00Add To Cart
CS0012 Email Cloaking - Spam Prevention$10.00Add To Cart

Recently Viewed Widgets 
Price 
# 
No data to display

Collapse/Expand
Format

Plug & Play Code

Copy the Source Code Above..


Collapse/Expand
License

License

PromoWare

Single Developer Licence.
Re-Distribution Permitted only as part of a compiled Application.This source code is provided to you "as is" without warranty.
CLICK HERE FOR TERMS OF USE
Copyright 2000-2018 CodeWidgets.com and Comrie Software Solutions


This website uses Cookies to store User information and Shopping Cart Items for the duration of your visit to CodeWidgets.com.

No Credit Card or Financial information is stored by CodeWidgets.com. Click Here For Our Complete Privacy Policy and Terms of Use.

I Understand