Disable Right Click on Images

This article will show you how to disable Right Click in your survey. 


See the following articles if you have not already:


Overview

You may want the ability to Disable Right Click on Images so a respondent does not have the ability to save the image. There are 2 ways to do this:

  1. Disable Right Click on an Entire Survey
  2. Disable Right Click on a Specific Item

Disable Right Click - Entire Survey

  1. Go to the Default Text Card
  2. Click on 'Survey Settings' in on the left
  3. Click on 'Default Text' 
  4. Click on the edit icon tied to the 'Survey Header' 
  5. Click on the source icon (</>) 
  6. Add the following code
    <script type="text/javascript">
     /*DISABLE RIGHT CLICK FOR THIS PAGE*/
     
     if (typeof cmSurvey !== 'undefined')
     {
     if (typeof cmSurvey.plugins === 'undefined')
     {
     cmSurvey.plugins = {};
     }
     (function($)
     {
     cmSurvey.plugins.stopRightClick = function(questionNames, config)
     {
     $("body").attr("oncontextmenu", "return false");
     };
     })(jQuery);
     }
     
     cmSurvey.onPageLoad(function()
     {
     cmSurvey.plugins.stopRightClick([],
     {});
     
     });
     
     </script>
    	
  7. Click on the source icon (</>) to close the code view 
  8. Once you are out of the code view, click 'SAVE' 
  9. You can now close the 'Default Text' Card

Disable Right Click - On a Specific Item

  1. Go to the Static Element that contains the image
  2. Click on the Editor icon 
  3. Click on the source icon (</>) 
  4. Add the following code under the image code
    <script type="text/javascript">
     /*DISABLE RIGHT CLICK FOR THIS PAGE*/
     
     if (typeof cmSurvey !== 'undefined')
     {
     if (typeof cmSurvey.plugins === 'undefined')
     {
     cmSurvey.plugins = {};
     }
     (function($)
     {
     cmSurvey.plugins.stopRightClick = function(questionNames, config)
     {
     $("body").attr("oncontextmenu", "return false");
     };
     })(jQuery);
     }
     
     cmSurvey.onPageLoad(function()
     {
     cmSurvey.plugins.stopRightClick([],
     {});
     
     });
     
     </script>
    	
  5. Click on the source icon (</>) to close the code view 
  6. Once you are out of the code view, click 'SAVE' 
  7. You can now close the Card
Did this answer your question? Thanks for the feedback There was a problem submitting your feedback. Please try again later.

Still need help? Contact Us Contact Us