04-20-2016 03:43 AM
Now for guest access I´m using as a username the DNI of the guest (number of personal identification used in Spain) and I use as validator funtion "IsValidSpanishDNI".
Now I want to use as a username the passport number of the guest if comes from another country , but I don´t know how to validate it. Is there any funtion to do it? How can I create a new one?
Solved! Go to Solution.
04-20-2016 07:40 AM
You could use the isRegexMatch validator and attempt to define your own regular expression. The problem you're going to run into is that every country is free to define their own passport numbers. You could restrict your regex to just machine readable passport numbers which appear to be 9 characters (letters or digits). http://www.highprogrammer.com/alan/numbers/mrp.htm
IsRegexMatch – Checks that the value matches a regular expression supplied as an argument to the validator. The regular expression should be a Perl-compatible regular expression with delimiters. For example, the validator argument /^a/i will match any value that starts with an “a”, case-insensitively.