inputEx - PasswordField Usage

Basic PasswordField creation

Use the following code to create a basic inputEx PasswordField.

new YAHOO.inputEx.PasswordField({parentEl: 'container1', showMsg: true});

Password and confirmation

We always want a password field with a confirmation

var pass1 = new YAHOO.inputEx.PasswordField({showMsg: true, required: true, parentEl: 'container2'}); var pass2 = new YAHOO.inputEx.PasswordField({showMsg: true, required: true, parentEl: 'container2'}); pass2.setConfirmationField(pass1);

Password length

Set the minimum password length using the minLength option :

new YAHOO.inputEx.PasswordField({parentEl: 'container3', showMsg: true, minLength: 10});

Password strength indicator

A widget indicating the strength of the password (useful for password creation) :

new YAHOO.inputEx.PasswordField({parentEl: 'container4', showMsg: true, strengthIndicator: true});

Caps Lock Warning

Display a warning if the caps lock key is on

new YAHOO.inputEx.PasswordField({parentEl: 'container5', showMsg: true, capsLockWarning: true});