Copy Paste Prevention - "Form" style text entry questions

B_Lab
B_Lab Community Member - Trial User Qubie ✭

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?

Tagged:

Best Answer

  • TomG
    TomG Raleigh, NCCommunity Member, Qualtrics Brand Admin Wizard ✭✭✭✭✭
    Accepted Answer

    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(); });
    });
    

Answers