Results 1 to 6 of 6

Thread: [ASK] Have a problem with My Password Validation

  1. #1
    Sencha User thenevermore's Avatar
    Join Date
    Nov 2012
    Location
    Bandung , Indonesia
    Posts
    10
    Vote Rating
    0
      0  

    Default [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 :
    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 :
    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
    }
    }
    How can i use password validation which is flexible to be applied..?

    If you have any idea may you write down here.


    Regards,

  2. #2
    Sencha Premium Member dawesi's Avatar
    Join Date
    Mar 2007
    Location
    Melbourne, Australia (aka GMT+10)
    Posts
    1,093
    Answers
    25
    Vote Rating
    56
      0  

    Default

    Quote Originally Posted by thenevermore View Post

    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?
    Lead Trainer / Sencha Specialist
    Community And Learning Systems

    Lead Architect
    DigitalTickets.net

  3. #3
    Sencha User thenevermore's Avatar
    Join Date
    Nov 2012
    Location
    Bandung , Indonesia
    Posts
    10
    Vote Rating
    0
      0  

    Default

    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 Like Add as Friend





    thenevermore Has Been Visited your thread?

  4. #4
    Sencha User
    Join Date
    Sep 2011
    Posts
    574
    Answers
    59
    Vote Rating
    74
      0  

    Default

    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.

  5. #5

  6. #6
    Sencha User thenevermore's Avatar
    Join Date
    Nov 2012
    Location
    Bandung , Indonesia
    Posts
    10
    Vote Rating
    0
      0  

    Default

    Case Closed

    Thank for all of you,,



    Nice To Meet You All
    1 second ago Like Add as Friend





    thenevermore Has Been Visited your thread?

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •