home  products examples manual  faq support forum  contact news  login store

More Examples:   View Source:   Javascript Regular Expression Validation of UserID

Free Download

(E) New Record     
(e)User ID*
(e)First Name
(e)Last Name
(e)Address Line 1
(e)Address Line 2


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.

email: (change # to @)     telephone (malaysia): 60-3-7947 2888     fax (malaysia): 60-3-7947 2800