pGenerator jQuery Plugin - Javascript password generator plugin

We have developed a jQuery plugin which can help you adding a password generator feature to your own accounts forms. This plugin generate a secure password and display it to the user.

pGenerator plugin defaults

$('#myLink').pGenerator({
    'bind': 'click',
    'passwordElement': null,
    'displayElement': null,
    'passwordLength': 16,
    'uppercase': true,
    'lowercase': true,
    'numbers':   true,
    'specialChars': true,
    'onPasswordGenerated': function(generatedPassword) { }
});
  1. bind - Bind an event to #myLink which generate a new password when raised;
  2. passwordElement - Selector for the form input which will contain the new generated password;
  3. displayElement - Selector which will display the new generated password;
  4. passwordLength - Length of the generated password. Default number of characters is 16;
  5. uppercase - Password will contain uppercase letters;
  6. lowercase - Password will contain lowercase letters;
  7. numbers - Password will contain numerical characters;
  8. specialChars - Password will contain special characters;
  9. onPasswordGenerated - Callback function which will be called each time a new password is generated;

How to use pGenerator jQuery Plugin:

$(document).ready(function(){
    	
    $('#myLink').pGenerator({
        'bind': 'click',
        'passwordElement': '#my-input-element',
        'displayElement': '#my-display-element',
        'passwordLength': 16,
        'uppercase': true,
        'lowercase': true,
        'numbers':   true,
        'specialChars': true,
        'onPasswordGenerated': function(generatedPassword) {
        	alert('My new generated password is ' + generatedPassword);
        }
    });
});

Demo

Generate a password

Download pGenerator jQuery Plugin

Download our latest version:

Download pGenerator.jQuery.js

comments powered by Disqus