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  
1VHOwsley Owsleycapelujpxm@yahoo.com
[Edit]
 
(E)  
(e)User IDVH
(e)First NameOwsley Owsley
(e)Last NameOwsley
(e)emailcapelujpxm@yahoo.com
(e)Address Line 1 
(e)Address Line 2 
(e)Postcode 
(e)City 
(e)State 
(e)Country 
(e)Age0
(e)Created19-08-2014 06:17:42 AM
  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