PDA

View Full Version : [ASK] Have a problem with My Password Validation



thenevermore
12 Nov 2012, 2:00 AM
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 :


password -> (False)
passWord -> (False)
passWord8 -> (False)
passWord88# ->(True)


Each of them is required , if one of them is missing , then message error will appear.

My current code is using vtype validation and have its own pattern like (two uppercase + upper/lowercase + number).
for example :
[spoiler]


ALarm123
THen90
ZEbrA70

Here's my vtype :


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
}
}



How can i use password validation which is flexible to be applied..?

If you have any idea may you write down here.
;)

Regards,

dawesi
12 Nov 2012, 9:40 AM
How can i use password validation which is flexible to be applied..?


I don't understand what you are asking?

Are you asking for a regular expression to validate your rules, or are you asking how to dynamically add and remove rules?

thenevermore
12 Nov 2012, 5:50 PM
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
:-?





Nice To Meet You All
1 second ago · http://3.bp.blogspot.com/-6uXPFr02yfE/TdvsxCLViqI/AAAAAAAAA4g/TFp_-T4PbyE/s400/3.png Like (http://www.sencha.com/forum/reputation.php?do=addreputation&p=910406) · http://2.bp.blogspot.com/-BfacKDG7xkE/TdveF4jZbtI/AAAAAAAAA4Q/u7tkCrdpT9w/s1600/2.png Add as Friend (http://www.sencha.com/forum/profile.php?do=addlist&userlist=buddy&u=522742)







thenevermore (http://www.sencha.com/forum/member.php?522742-thenevermore) Has Been Visited your thread™

ettavolt
17 Nov 2012, 1:42 AM
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.

vietits
17 Nov 2012, 5:01 AM
See the answer here: http://www.sencha.com/forum/showthread.php?248849-ASK-Have-a-problem-with-My-Password-Validation-2

thenevermore
18 Nov 2012, 7:59 PM
Case Closed

Thank for all of you,,
:)



Nice To Meet You All
1 second ago · http://3.bp.blogspot.com/-6uXPFr02yfE/TdvsxCLViqI/AAAAAAAAA4g/TFp_-T4PbyE/s400/3.png Like (http://www.sencha.com/forum/reputation.php?do=addreputation&p=910406) · http://2.bp.blogspot.com/-BfacKDG7xkE/TdveF4jZbtI/AAAAAAAAA4Q/u7tkCrdpT9w/s1600/2.png Add as Friend (http://www.sencha.com/forum/profile.php?do=addlist&userlist=buddy&u=522742)







thenevermore (http://www.sencha.com/forum/member.php?522742-thenevermore) Has Been Visited your thread?