I am trying to prevent people from pasting into a a from-style text entry question in a survey I am creating. I have a code that prevents Copy/Paste into a typical text box (works for "single line", "multi line", "essay text box," and "password" text entries); but, it does not work with "form" text entry boxes. Does anybody have an effective copy/paste Javascript that works with form-style questions?
Page 1 / 1
This should work on any type of text inputs in a question:
```
Qualtrics.SurveyEngine.addOnload(function() {
jQuery("#"+this.questionId+" textarea,input[type=text]").on("paste", function(e) { e.preventDefault(); });
});
```
```
Qualtrics.SurveyEngine.addOnload(function() {
jQuery("#"+this.questionId+" textarea,input[type=text]").on("paste", function(e) { e.preventDefault(); });
});
```
This is perfect! Thank you!
Leave a Reply
Enter your E-mail address. We'll send you an e-mail with instructions to reset your password.