Hi all,
I’m stuck creating custom validation for a number entered in a form question.
Subjects need to enter a “valid” ID we give them manually in the beginning in order to start the survey.
The ID is 6 digits, the last one being a control digit we created. Meaning that it has the following logic
suppose the 5 first digits are 98739, we multiply each digit by either 2 or 1 (alternating), and then sum it up : 9x2 +8x1 +7x2 + 3x1 +9x2 = 18 + 8 + 14 + 3 + 18 = 61
so we added a 6th digits that is equal to 61 mod 10, that is 1.
Meaning that 987391 is a valid ID, but 987394 isn’t.
So far, I’ve been able to check that subject entered 6 digits using Regex /^[0-9]{6}$/gi
I assume I need to add custom JavaScript to actually check the 6th digit, but I unfortunately have little to no understanding of how to do that.
Would appreciate any help I can get.
Thank you all!
RP