PHPLens: 4.9.2 Data: 0.02 DB: mysql adodb: 4.62 Compat: 2 PHP: 5.2.17 OS: Linux License Type: Enterprise ID: (Natsoft;John Lim;jlim@natsoft.com) Valid Till: Never Expires
Notes
Same example as example 300, but not userid's are validated. First character of userid must
be non-numeric character (a-z or A-Z), and must be at least 4 characters in length and no more than 16 characters.
We can use a javascript regular expression
to validate like this:
$lens->validation =
'USERID^=[a-zA-Z][a-zA-Z0-9]{3,16}$^UserID must be 4-16 chars long and cannot start with a number';
The $ indictates that no further characters will be accepted (end-of-line).
Alternatively (not used in this example), you can use an input mask such as:
$lens->validation =
'USERID^=XXXXxxxxxxxxxxxx^UserID must be at least 4 chars long';
but this will not check that the first character is non-numeric.