You need to sign in to do that
Don't have an account?

Validating with javascript, possible?
Hey, what do you think... is it possible to validate a field with a s-control (javascript)? I'm now validating SSN field with REGEX, but would like to improve the validation with javascript code.
Best Regards,
TP
Well, here's some background:
In Finland, the personal identification number (Finnish: henkilötunnus (HETU), Swedish: personbeteckning), formerly known as sosiaaliturvatunnus (SOTU) Social Security number) is used for identifying the citizens in many government and civilian systems. It uses the form DDMMYYCZZZQ, where DDMMYY is the date of birth, C is the century identification sign (+ for the 19th century, - for the 20th and A for the 21st), ZZZ is the personal identification number (odd number for males, even number for females) and Q is a checksum character. For example, a valid henkilötunnus is 311280-999J.
The checksum character is calculated thus: Take the birth date and person number, and join them into one 9-digit number x. Let n = x mod 31. Then the checksum letter is the (n+1)th character from this string: "0123456789ABCDEFHJKLMNPRSTUVWXY".
(http://en.wikipedia.org/wiki/National_identification_number#Finland)
I'm now validating SSN with REGEX, and also would want to add that checksum character validation to my rule. I also have one working javascript code available (for that checksum calcutations), but I don't know how to modify my REGEX to use it (or use it some other way). The logic is clear though. :smileyhappy:
Best Regards,
TP
Yes, but the checksum (last character of SSN) is the challenging one. I think that it can't be included to regex validation rule. And that's why I'm wondering what to do with my javascript code...
BR,
TP