Welcome, Guest
Username: Password: Remember me

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

HELP REQUEST. Validation syntaxis (donation available). 1 year 9 months 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: 1 year 9 months ago by jasepulveda.
The administrator has disabled public write access.

HELP REQUEST. Validation syntaxis (donation available). 1 year 9 months ago #101744

  • tpartner
  • tpartner's Avatar
  • Offline
  • LimeSurvey Team
  • Posts: 5101
  • Thank you received: 1048
  • Karma: 440
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.

LimeSurvey is open-source and run entirely by volunteers so please consider donating to support the project.
The administrator has disabled public write access.

HELP REQUEST. Validation syntaxis (donation available). 1 year 9 months 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). 1 year 9 months ago #101749

  • tpartner
  • tpartner's Avatar
  • Offline
  • LimeSurvey Team
  • Posts: 5101
  • Thank you received: 1048
  • Karma: 440
Working survey attached.

File Attachment:

File Name: limesurvey...9781.lss
File Size:13 KB

This message has an attachment file.
Please log in or register to see it.

Cheers,
Tony Partner

Solutions, code and workarounds presented in these forums are given without any warranty, implied or otherwise.

LimeSurvey is open-source and run entirely by volunteers so please consider donating to support the project.
Last Edit: 1 year 6 months ago by tpartner.
The administrator has disabled public write access.
Moderators: ITEd
Time to create page: 0.133 seconds