Willkommen, Gast
Benutzername: Passwort: Angemeldet bleiben:

THEMA: Prevent Copy/Paste into questions?

Prevent Copy/Paste into questions? 1 Jahr 6 Monate her #92742

  • LSCitizen
  • LSCitizens Avatar
  • OFFLINE
  • Junior Lime
  • Beiträge: 33
  • Karma: 0
Hello -
Is there a way to prevent users from copying and pasting values into Short Free Text, Numerical Input and DatePicker questions?

Thanks..
Der Administrator hat öffentliche Schreibrechte deaktiviert.

Prevent Copy/Paste into questions? 1 Jahr 6 Monate her #92750

  • DenisChenu
  • DenisChenus Avatar
  • OFFLINE
  • Moderator Lime
  • Beiträge: 6276
  • Dank erhalten: 801
  • Karma: 240
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
Der Administrator hat öffentliche Schreibrechte deaktiviert.

Prevent Copy/Paste into questions? 1 Jahr 6 Monate her #92751

  • holch
  • holchs Avatar
  • ONLINE
  • LimeSurvey Team
  • Beiträge: 2634
  • Dank erhalten: 309
  • Karma: 114
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.
Have a look at the manual! It is a really valuable source for information. Here some helpful links:
Manual (EN) | Question Types | Question Attributes | Workarounds

If you found this answer helpful and it saved you some time please consider a donation to the project to keep Limesurvey going!
Der Administrator hat öffentliche Schreibrechte deaktiviert.
Moderatoren: ITEd
Ladezeit der Seite: 0.149 Sekunden
Donation Image