-
12 Nov 2012 2:00 AM #1
Unanswered: [ASK] Have a problem with My Password Validation
Unanswered: [ASK] Have a problem with My Password Validation
Dear all ,
There was a problem with my code about password validation.

I want to create a validation that requires at least one digit (0-9) , one lowercase (a-z) , one uppercase (A-Z) and one symbol (!@#$%^&*-=+)
for example :
Each of them is required , if one of them is missing , then message error will appear.password -> (False)
passWord -> (False)
passWord8 -> (False)
passWord88# ->(True)
My current code is using vtype validation and have its own pattern like (two uppercase + upper/lowercase + number).
for example :
[spoiler]
Here's my vtype :ALarm123
THen90
ZEbrA70
How can i use password validation which is flexible to be applied..?Code:Ext.form.VTypes=function() { var k = /^([A-Z]{2})[A-Za-z\-]+[0-9_]+/; return { passpos : function(e) { return k.test(e) }, passposText : "Wajib mengandung Huruf besar,huruf kecil, dan angka", passposMask : /[A-Za-z0-9_]/i } }
If you have any idea may you write down here.

Regards,
-
12 Nov 2012 9:40 AM #2Sencha - Sales Team
- Join Date
- Mar 2007
- Location
- Melbourne, Australia (aka GMT+10)
- Posts
- 738
- Vote Rating
- 6
- Answers
- 10
Check out SenchaWorld.com for articles, screencasts, conference videos and more.
Sencha Technical Training : Asia Pacific Region
Code Validation : JSLint | JSONLint | JSONPLint
-
12 Nov 2012 5:50 PM #3
hi dawesi , thanks for your reply,
yep , regular expression..

my current rule has its own pattern , (2 uppercase followed by upper/lowercase and then number) -> PAssword80 or VAlidaTion99, which is not user friendly.
How can i set rules where uppercase and number can dynamically placed anywhere like this -> paSswOrd80

thenevermore Has Been Visited your thread
-
17 Nov 2012 1:42 AM #4
With regex, you will need 3!=6 ORs in it (upper, number, symbol | upper, symbol, number | number, upper, symbol | etc) because regex is intended to match sequence. I advise you to do this with function - find with 3 simple regexes checking if word has a required symbol.
-
17 Nov 2012 5:01 AM #5
-
18 Nov 2012 7:59 PM #6


Reply With Quote



