The LimeSurvey Fund-Raiser 2012 is complete. Thank you for donating a total of 25,000 USD!     List of donors »

Welcome, Guest
Username: Password: Remember me
  • Page:
  • 1

TOPIC: Prevent Copy/Paste into questions?

Prevent Copy/Paste into questions? 3 months 1 week ago #92742

  • LSCitizen
  • LSCitizen's Avatar
  • OFFLINE
  • Junior Lime
  • Posts: 21
  • 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..
The administrator has disabled public write access.

Prevent Copy/Paste into questions? 3 months 1 week ago #92750

  • DenisChenu
  • DenisChenu's Avatar
  • NOW ONLINE
  • Moderator Lime
  • Posts: 4431
  • Thank you received: 460
  • Karma: 167
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
The administrator has disabled public write access.

Prevent Copy/Paste into questions? 3 months 1 week ago #92751

  • holch
  • holch's Avatar
  • OFFLINE
  • LimeSurvey Team
  • Posts: 1975
  • Thank you received: 156
  • Karma: 80
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!
The administrator has disabled public write access.
  • Page:
  • 1
Moderators: DenisChenu, ITEd
Time to create page: 0.238 seconds
Donation Image