Check out the LimeSurvey source code on GitHub!

Prevent Copy/Paste into questions?

More
4 years 1 week ago #92742 by LSCitizen
Hello -
Is there a way to prevent users from copying and pasting values into Short Free Text, Numerical Input and DatePicker questions?

Thanks..

Please Log in to join the conversation.

More
4 years 1 week ago #92750 by DenisChenu
Not tested,

But someting like this:
$(document).ready(function()
{
    var ctrlDown = false;
    var ctrlKey = 17, vKey = 86, cKey = 67;
 
    $(document).keydown(function(e)
    {
        if (e.keyCode == ctrlKey) ctrlDown = true;
    }).keyup(function(e)
    {
        if (e.keyCode == ctrlKey) ctrlDown = false;
    });
 
    $(":text,textarea").keydown(function(e)
    {
        if (ctrlDown && (e.keyCode == vKey || e.keyCode == cKey)) return false;
    });
})
Source : stackoverflow.com/a/2904944

Denis

Assistance on LimeSurvey forum and LimeSurvey core development are on my free time.
I'm not a LimeSurvey GmbH member, professional service on demand (or search sondages pro).

Please Log in to join the conversation.

More
4 years 1 week ago #92751 by holch
That would annoy me like hell. A website (which a online survey is somehow), shouldn't want to play around with my browser or desktop.

First thing would be to switch of JavaScript and do it anyway.

I'm not a LimeSurvey GmbH member. I answer at the LimeSurvey forum in my spare time. No support via private message.
Some helpful links: Manual (EN) | Question Types | Workarounds

Please Log in to join the conversation.

Imprint                   Privacy policy         General Terms & Conditions         Revocation information and revocation form