Hi guys
I have to put a validation in a Policy number textbox so that it can accept in total 8 characters and meets the following conditions.
1. First 7 characters are digits(0 to 9)
2. Last character is any Alphabet(a-Z)
3. Multiple first digit by 2, the second by 4,third by 8,fourth by 5,fifth by 10,sixth by 9 and seventh by 7.
Add these all together & divide by 11. The last (8th character) is based on the remainder.
if remainder =0 then
it can be 'A','C' OR 'X'
elseif remainder =1 then
it can be 'B','E' OR 'A'
elseif remainder =2 then
it can be 'D','G' OR 'C'
elseif remainder =3 then
it can be 'F','J' OR 'E'
elseif remainder =4 then
it can be 'H','L' OR 'F'
elseif remainder =5 then
it can be 'K','M' OR 'J'
elseif remainder =6 then
it can be 'N','Q' OR 'L'
elseif remainder =7 then
it can be 'P','R' OR 'M'
elseif remainder =8 then
it can be 'T','S' OR 'R'
elseif remainder =9 then
it can be 'U','W' OR 'T'
elseif remainder =10 then
it can be 'X','Y' OR 'W'
Anything else isn't a valid policy number.I hope anyone can help me to do it.
Thanks
I have to put a validation in a Policy number textbox so that it can accept in total 8 characters and meets the following conditions.
1. First 7 characters are digits(0 to 9)
2. Last character is any Alphabet(a-Z)
3. Multiple first digit by 2, the second by 4,third by 8,fourth by 5,fifth by 10,sixth by 9 and seventh by 7.
Add these all together & divide by 11. The last (8th character) is based on the remainder.
if remainder =0 then
it can be 'A','C' OR 'X'
elseif remainder =1 then
it can be 'B','E' OR 'A'
elseif remainder =2 then
it can be 'D','G' OR 'C'
elseif remainder =3 then
it can be 'F','J' OR 'E'
elseif remainder =4 then
it can be 'H','L' OR 'F'
elseif remainder =5 then
it can be 'K','M' OR 'J'
elseif remainder =6 then
it can be 'N','Q' OR 'L'
elseif remainder =7 then
it can be 'P','R' OR 'M'
elseif remainder =8 then
it can be 'T','S' OR 'R'
elseif remainder =9 then
it can be 'U','W' OR 'T'
elseif remainder =10 then
it can be 'X','Y' OR 'W'
Anything else isn't a valid policy number.I hope anyone can help me to do it.
Thanks