# inputEx - PasswordField Usage

## Basic PasswordField creation

Use the following code to create a basic inputEx PasswordField.

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

## Password and confirmation

The confirm option makes sure there is no typo in new passwords. Use it in combination with an id set on the password field to compare with.

// Using the json instanciation method : inputEx({ type: 'group', fields: [ {type: 'password', label: 'New password', showMsg: true, required: true, id: 'firstPassword' }, {type: 'password', label: 'Confirmation', showMsg: true, required: true, confirm: 'firstPassword' } ], parentEl: 'container2' });

## Password length

Set the minimum password length using the minLength option :

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

## Password strength indicator

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

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

## Caps Lock Warning

Display a warning if the caps lock key is on

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