Use the following code to create a basic inputEx PasswordField.
1 | new inputEx.PasswordField({parentEl: 'container1', showMsg: true}); |
view plain | print | ? |
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.
1 | // Using the json instanciation method : |
2 | inputEx({ |
3 | type: 'group', |
4 | fields: [ |
5 | {type: 'password', label: 'New password', showMsg: true, required: true, id: 'firstPassword' }, |
6 | {type: 'password', label: 'Confirmation', showMsg: true, required: true, confirm: 'firstPassword' } |
7 | ], |
8 | parentEl: 'container2' |
9 | }); |
view plain | print | ? |
Set the minimum password length using the minLength option :
1 | new inputEx.PasswordField({parentEl: 'container3', showMsg: true, minLength: 10}); |
view plain | print | ? |
A widget indicating the strength of the password (useful for password creation) :
1 | new inputEx.PasswordField({parentEl: 'container4', showMsg: true, strengthIndicator: true}); |
view plain | print | ? |
Display a warning if the caps lock key is on
1 | new inputEx.PasswordField({parentEl: 'container5', showMsg: true, capsLockWarning: true}); |
view plain | print | ? |