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

TOPIC: HELP REQUEST. Validation syntaxis (donation available).

HELP REQUEST. Validation syntaxis (donation available). 3 years 2 weeks ago #101691

Hi there

I work at an univerversity and I'm creating a survey for students where they have to enter their college registration ID, so I need a validation syntaxis for it.

The ID is composed of a 11 characters, only the 9th character can go from 0-9 or a K, and all the rest characters go from 0-9.

Examples:
15255806K01
15853966703
23654876K13
11345679212

Thanks in advance.

PD: Donation will be made through paypal for the first working syntax.
Last Edit: 3 years 2 weeks ago by jasepulveda.
The administrator has disabled public write access.

HELP REQUEST. Validation syntaxis (donation available). 3 years 2 weeks ago #101744

  • tpartner
  • tpartner's Avatar
  • Offline
  • LimeSurvey Team
  • Posts: 6568
  • Thank you received: 1477
  • Karma: 579
Assuming the "K" must be uppercase, use this as the question validation equation in the advanced settings:

regexMatch('/^\d{8}[\d|K]\d{2}$/', this)
Cheers,
Tony Partner

Solutions, code and workarounds presented in these forums are given without any warranty, implied or otherwise.
The administrator has disabled public write access.

HELP REQUEST. Validation syntaxis (donation available). 3 years 2 weeks ago #101748

Hi there, Thanks for your answer. Just tried but it didn't work. I tried with only numbers and with the "K" variant but neither of them seems to work.

I dont knot if I missed something else, you can check the test here:
http://observatoriocip.ufro.cl/encuestas/index.php?sid=67243&lang=es

Thanks in advance.
The administrator has disabled public write access.

HELP REQUEST. Validation syntaxis (donation available). 3 years 2 weeks ago #101749

  • tpartner
  • tpartner's Avatar
  • Offline
  • LimeSurvey Team
  • Posts: 6568
  • Thank you received: 1477
  • Karma: 579
Working survey attached.

File Attachment:

File Name: limesurvey...9781.lss
File Size:13 KB
Cheers,
Tony Partner

Solutions, code and workarounds presented in these forums are given without any warranty, implied or otherwise.
Last Edit: 2 years 9 months ago by tpartner.
The administrator has disabled public write access.
Time to create page: 0.214 seconds
Imprint                   Privacy policy         General Terms & Conditions         Revocation information and revocation form