Mask Password With Asterisk (*) While Typing - Passwordify.js

File Size: 16.1 KB
Views Total: 8742
Last Update:
Publish Date:
Official Website: Go to website
License: MIT
   
Mask Password With Asterisk (*) While Typing - Passwordify.js

Passwordify.js is a password masking jQuery library that automatically masks password characters with asterisks (***) while typing.

Requires jQuery library and jQuery mask plugin.

See also:

How to use it:

1. Load the necessary jQuery and jQuery mask libraries in the html page.

<script src="https://code.jquery.com/jquery-1.12.4.min.js" 
        integrity="sha384-nvAa0+6Qg9clwYCGGPpDQLVpLNn0fRaROjHqs13t4Ggj3Ez50XnGQqc/r8MhnRDZ" 
        crossorigin="anonymous">
</script>
<script src="https://cdnjs.cloudflare.com/ajax/libs/jquery.mask/1.14.15/jquery.mask.min.js"></script>

2. Download and load the Passwordify.js script after jQuery.

<script src="jquery.passwordify.js"></script>

3. Attach the plugin to the target text field and done.

<input type="text" id="example" data-val="" value="" placeholder="Enter your PIN">
$(document).ready(function(){
  $("#example").passwordify().focus();
});

4. Specify the maxumum number of characters allowed to type in the text field. Default: 8.

$("#example").passwordify({
  maxLength: 6
})

5. Execute a function after you've typed the password.

$("#example").passwordify({
  enterKeyCallback: function(){
    // do something
  }
})

6. Only allow letters and/or numbers for your password.

$("#example").passwordify({
  numbersOnly: false,
  alphaOnly: false,
  alNumOnly: false
})

This awesome jQuery plugin is developed by cloudmedia. For more Advanced Usages, please check the demo page or visit the official website.