phpLens
 home  products examples manual  faq support forum  contact news  login store

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

Free Download

  PHPLens
E New Srch
(E) (e)User ID (e)Name (e)email  
1123456124345 12345test@test.com
[Edit]
 
(E)  
(e)User ID123456
(e)First Name124345 12345
(e)Last Name12345
(e)emailtest@test.com
(e)Address Line 1123
(e)Address Line 2123
(e)Postcode123
(e)City123
(e)State123
(e)Country123
(e)Age12
(e)Created30-01-2012 06:40:42 PM
  PHPLens (Page 1)  
E New Srch

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.

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