Welcome, Guest
Username: Password: Remember me

TOPIC: Check if entered number is unique

Check if entered number is unique 2 years 2 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.

Re: Check if entered number is unique 2 years 2 months ago #74293

  • holch
  • holch's Avatar
  • OFFLINE
  • LimeSurvey Team
  • Posts: 2444
  • Thank you received: 254
  • Karma: 94
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 | 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.

Re: Check if entered number is unique 2 years 2 months ago #74351

  • DenisChenu
  • DenisChenu's Avatar
  • OFFLINE
  • Moderator Lime
  • Posts: 5845
  • Thank you received: 715
  • Karma: 222
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
The administrator has disabled public write access.
Moderators: ITEd
Time to create page: 0.119 seconds
Donation Image