Welcome to the LimeSurvey Community Forum

Ask the community, share ideas, and connect with other LimeSurvey users!

Validation of ID number

  • jma6610
  • jma6610's Avatar Topic Author
  • Offline
  • Senior Member
  • Senior Member
More
5 years 2 months ago #179829 by jma6610
Validation of ID number was created by jma6610
I'm using Lime 2.5x and trying to make sure that the user enters a correct 7 digit numeric-only ID number by having them enter it twice and making sure the two match. I'm guessing that this may be best on two separate pages/questions (where the questions are shown one-by-one). Although I can do this with the following verification,

{if(Number1.NAOK == Number2.NAOK,' ','DOES NOT MATCH')}

it works awkwardly since the text warning appears as the participant is tying and does not disappear until after the entire entry is finished and matches with the first entry.

Is there a better way to do this so that the comparison/validation does not occur until after the last of the 7 digits is entered or alternatively, done so that the "doesn't match" warning doesn't appear until after the first incorrect digit is entered ?

Thanks
Jeff
The topic has been locked.
  • DenisChenu
  • DenisChenu's Avatar
  • Offline
  • LimeSurvey Community Team
  • LimeSurvey Community Team
More
5 years 2 months ago #179837 by DenisChenu
Replied by DenisChenu on topic Validation of ID number
Code:
{if(strlen(Number2.NAOK) < 7 or Number1.NAOK == Number2.NAOK,' ','DOES NOT MATCH')}
 {if(strlen(Number2.NAOK) < 7,'need 7 caracter','')}

You can use manual.limesurvey.org/Question_type_-_Sh...28em_validation_q.29
Unsuire it was here in 2.5X version but if it's here:

For equation :
Code:
strlen(Number2.NAOK) == 7 and Number1.NAOK == Number2.NAOK

For tip
Code:
{if(strlen(Number2.NAOK) < 7,'need 7 caracter','')}
{if(Number1.NAOK != Number2.NAOK,'This id is valid','')}
[if(Number1.NAOK == Number2.NAOK,'All is OK, go next','')}

Assistance on LimeSurvey forum and LimeSurvey core development are on my free time.
I'm not a LimeSurvey GmbH member, professional service on demand , plugin development .
I don't answer to private message.
The topic has been locked.

Lime-years ahead

Online-surveys for every purse and purpose