Skip to main content
Nintex Community Menu Bar

Stop Right Click Code

  • January 21, 2019
  • 3 replies
  • 27 views

I am trying to disable the right click for users. Does anyone know the correct HTML code? I have tried using <body oncontextmenu="return false;"> to no avail. I want the end user to be unable to right click and see the form url as I have embedded the form within another website using an Iframe.

3 replies

Forum|alt.badge.img+16
  • January 21, 2019

Thank you for the suggestion. Unfortunately, it did not work. I am also trying to block the right click for the entire form and not just the image. Really cool idea though!

 


Forum|alt.badge.img+9

Hi

Add the following  code under your html and test it by  right clicking on your page.

<script language="JavaScript"> document.addEventListener("contextmenu", function(e){ e.preventDefault(); }, false); </script>

if this page is helpful  dont forget to mark it as both KUDOS and solution or KUDOS only.

Regards

Elvis