I would like to create the following validation criteria for "Short free text" question: first sign must be capital letter A-Z and second sign must be number 0-9, everything else can be numbers. Is it possible to do this from the menu "Edit question -> Advanced settings -> Question validation equation"?
I tried some of the examples equations that are mentioned in the limesurvey manual but for some reason I could not get them to work (even when I just copypasted them). I would really appreciate if you would be able to tell me what I need to type in the "Question validation equation" box to get the rule working. Thank you in advance!
You can use either the "Validation" or the "Question validation equation" fields. The "Question validation equation" allows for far greater flexibility in the validation criteria but requires the use of Expression Manager syntax.
Something like this (which also restricts any characters after the first two to be numeric):
Code:
regexMatch("/^[A-Z][0-9][0-9]*$/", this)
Cheers,
Tony Partner Solutions, code and workarounds presented in these forums are given without any warranty, implied or otherwise.