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

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

Free Download

This is a Demo. You can not change anything for security reasons.
Back to Grid     phpLens Settings  Column Settings   Choose   Generate PHP Code   Remove All Settings   ?  

Select Read Only Columns

 Editable Cols

    >>    

    <<

Read Only Cols
Up   Down
 
    Cancel
   

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