What is JotForm?
JotForm is a free online form builder which helps you create online forms without writing a single line of code. No sign-up required.

At JotForm, we want to make sure that you’re getting the online form builder help that you need. Our friendly customer support team is available 24/7.

We believe that if one user has a question, there could be more users who may have the same question. This is why many of our support forum threads are public and available to be searched and viewed. If you’d like help immediately, feel free to search for a similar question, or submit your question or concern.


  • Profile Image

    Disabling right click and highlighting functionality using Javascript

    Asked by Andrew Nicholson 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?
    javascript js disable right click disable highlighting right click highlighting disable
  • Profile Image
    JotForm Support

    Answered by Jan 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.