Check out the LimeSurvey source code on GitHub!
Welcome, Guest
Username: Password:

TOPIC: Check if entered number is unique

Check if entered number is unique 4 years 9 months ago #74286

  • hovardkr
  • hovardkr's Avatar
  • Offline
  • Fresh Lemon
  • Posts: 1
  • Karma: 0
Hi!

In our survey we have a numeric field where the customers enters a code that can be used once.

How can I check if this code has not allready been used?
The administrator has disabled public write access.

Check if entered number is unique 4 years 9 months ago #74293

  • holch
  • holch's Avatar
  • Offline
  • LimeSurvey Team
  • Posts: 5446
  • Thank you received: 814
  • Karma: 240
With the normal Limesurvey tools, there is no possibility to check if it has been used in any other survey. You will need to do some custom programming to read the database and check if the code exists already.

For what do you need the code? Maybe the token feature can already solve your problem?
Have a look at the manual! It is a really valuable source for information. Here some helpful links:
Manual (EN) | Question Types | [url=https://manual.limesurvey.org/Workarounds[/url]

If you found this answer helpful and it saved you some time please consider a [url=https://donate.limesurvey.org[/url] to the...
The administrator has disabled public write access.

Check if entered number is unique 4 years 9 months ago #74351

  • DenisChenu
  • DenisChenu's Avatar
  • Offline
  • Moderator Lime
  • Posts: 9600
  • Thank you received: 1376
  • Karma: 390
Hello,

The only solution seem to use ajax, call a ajax function after click on movenext, this function take the number already set in the database, and return false if the number exist.

There are some work for a good javascript and php script solution.

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 (use private message).
The administrator has disabled public write access.
Time to create page: 0.219 seconds
Imprint                   Privacy policy         General Terms & Conditions         Revocation information and revocation form