Disabling right click and highlighting functionality using Javascript

  • Profile Image
    Andrew Nicholson
    Asked on December 28, 2014 at 07:59 AM
    1e) Is it possible to present (protect from copying) the questions so that they cannot be cut and pasted from the screen?
  • Profile Image
    Jan
    Answered on December 28, 2014 at 10:14 AM

    Hello,

    It is possible however you will need to add custom Javascript or codes on your webpage. Because, there is no setting in JotForm that will disable the right click and highlight function. So disabling the right click and highlighting functionality will avoid the users to copy and paste the questions.

    You can use this Javascript code and paste under the <body> tag.

    <script language="JavaScript" type="text/javascript" >

    <!-- 

    document.oncontextmenu = function() {return false}

    if (document.layers) {

      window.captureEvents(Event.MOUSEDOWN);

      window.onmousedown = function(e) {

        if (e.target==document) return false;

      }

    }

    else {

      document.onmousedown = function() {return false}

    }

    //-->

    </script>

     

    Hope this helps. Thank you.