Have an idea?

Visit Sawtooth Software Feedback to share your ideas on how we can improve our products.

Disabling copying and pasting within a survey

Hi there, I've seen this issue come up in the past and my recollection is there wasn't any wonderful solutions. Or is there?

Are there any easy methods to apply to prevent copying / pasting of confidential material that is displayed within a survey?

Or is there methods to make it more difficult?

Looking forward a to your reply.

Thank you.
asked Aug 16, 2017 by Paul Moon Platinum (97,120 points)

1 Answer

0 votes
Hey Paul,

Please try the below code for your requirement :


<script type="text/javascript">

$(document).ready(function(){
  $('.numeric_input').live("cut copy paste",function(e) {
    e.preventDefault();
  });
});

$(".numeric_input").on("contextmenu",function(e){
            return false; /*right click disable*/
    });
</script>


The above code will function for disabling the copy paste and also i have provided the right click disabling which can avoid pasting through mouse  clicks


Place the above in footer and based on the question please the class, as now i have provided the code for "numeric_input"
answered Aug 16, 2017 by sandeepkapalawai Bronze (1,455 points)
Even if you try in normal open ended question it should work.

Can you please check the class by right clicking on inspect element and let me know what class you would be able to see it
Looks like ...

<div class="question openend" id="Q1a_div">
Hi Paul,

In that case the class  "question openend" should be replaced with the code what i have gave you .

<script type="text/javascript">
  
$(document).ready(function(){
  $('.question openend).live("cut copy paste",function(e) {
    e.preventDefault();
  });
});
  
$(".question openend").on("contextmenu",function(e){
            return false; /*right click disable*/
    });
</script>


It looks like that classes from 8.4.8 vary from light house
I tried this the moment I looked up the class and still had issues?

I'll double check the script is pasted in correctly tomorrow and report back to this post.

But no success yet?
extremely sorry the code which i have sent you above has some typos

plz find the below one :


<script type="text/javascript">
   
$(document).ready(function(){
  $(".question openend").live("cut copy paste",function(e) {
    e.preventDefault();
  });
});
   
$(".question openend").on("contextmenu",function(e){
            return false; /*right click disable*/
    });
</script>


Also i suggest you to check the class again as far i know there will not a be space for the words like which you have sent in the above comment as  <div class="question openend" >
...