Well, the function "CheckID" works fine, but the function "CheckInput" has to be revised.
Now you use an HTML form with an "onClick"-event. (I wonder why there is a "document.ready")
By the way:
As I am not able to create any javascript function (only adapt some), I tried to validate your ID.
And it works.
Knowing that you can precalculate A1(i) + A2(i)*9 to A3(i):
(01,10,19,28,37,46,55,64,73,82,02,11,20,29,38,47,56,65,74,83,03,12,21,30,39,48 ),
you get this question validation equation.
(strlen(self)==10) and
(strpos('#ABCDEFGHJKLMNPQRSTUVXYWZIO',substr(self,0,1))>0) and
(is_numeric(substr(self,1))) and
(floor(sum(substr("0110192837465564738202112029384756657483031221303948", 2*strpos('ABCDEFGHJKLMNPQRSTUVXYWZIO',substr(self,0,1)),2), sum(8*substr(self,1,1), 7*substr(self,2,1), 6*substr(self,3,1), 5*substr(self,4,1), 4*substr(self,5,1), 3*substr(self,6,1), 2*substr(self,7,1), 1*substr(self,8,1), 1*substr(self,9,1)))/10)== sum(substr("0110192837465564738202112029384756657483031221303948", 2*strpos('ABCDEFGHJKLMNPQRSTUVXYWZIO',substr(self,0,1)),2), sum(8*substr(self,1,1), 7*substr(self,2,1), 6*substr(self,3,1), 5*substr(self,4,1), 4*substr(self,5,1), 3*substr(self,6,1), 2*substr(self,7,1), 1*substr(self,8,1),1*substr(self,9,1)))/10)
Well, of course it is not more than an example to show what is possible.
You could replace the first (green) lines by a Regular expression like
regexMatch('/^[ABCDEFGHJKLMNPQRSTUVXYWZIO]{1}[0-9]{9}$/',self)
Anyway: A javascript solution might be better.
Joffm
Volunteers are not paid.
Not because they are worthless, but because they are priceless
The topic has been locked.