Saturday, May 24, 2014

Check Password strength using Passy Jquery Plugin

Hi friends.In this post i am going to show how to Check Password strength using Passy Jquery Plugin.I have used Passy jquery plugin to check password strength.


JQuery Functions

      <script type="text/javascript">
    var $password = $('#password');
    var $strength = $('#strength');

    $.passy.requirements.length.min = 4;

    var feedback = [
        { color: '#FF3300', text: 'Very Weak' },
        { color: '#009933', text: 'Weak' },
        { color: '#00FF99', text: 'Good' },
        { color: '#00FF33', text: 'Very Strong' }
   ];

        $password.passy(function(strength, valid) {
        $strength.text(feedback[strength].text);
        $strength.css('background-color', feedback[strength].color);

    });

 
</script>

HTML Form

<form method="post" action="#">
      Enter your password :
      <input type="password" id="password" placeholder="Enter your password" />
      <span id="strength">...</span>
    </form>

Please share your comments and feebback.Thanks.Please subscribe my updates via email.

No comments:

Post a Comment