# inputEx-library

### inputEx 0.5.1

inputEx-library > inputEx > inputEx.PasswordField
Search:
Filters Show Private Show Protected Show Deprecated

## Class inputEx.PasswordField - extends inputEx.StringField

Create a password field.

### Constructor

inputEx.PasswordField `( options )`

Parameters:
  `options <Object>` inputEx.Field options object
  - confirmPasswordField: the PasswordField instance to compare to when using 2 password fields for password creation (please use the setConfirmationField method)
  - strengthIndicator: display a widget to indicate password strength (default false)
  - capsLockWarning: display a warning if CapsLock is on (default false)
  - confirm: id of the field to compare to

### Properties

#### byId - `object`

Keep track of all instances, indexed by ids, for the password confirmation field

#### Properties inherited from inputEx.Field:

`options`

### Methods

#### getPasswordStrength

`void getPasswordStrength ( )`
Return an integer within [0,100] that quantify the password strength Function taken from Mozilla Code: (changed a little bit the values) http://lxr.mozilla.org/seamonkey/source/security/manager/pki/resources/content/password.js

#### getStateString

`void getStateString ( )`
Change the state string

#### onInput

`void onInput ( e )`
Update the state of the confirmation field

Parameters:
  `e <Event>` The original input event

#### onKeyPress

`void onKeyPress ( )`
callback to display the capsLockWarning

#### onKeyUp

`void onKeyUp ( )`
onkeyup callback to update the strength indicator

#### renderComponent

`void renderComponent ( )`
Set the el type to 'password'

#### setCapsLockWarning

`void setCapsLockWarning ( )`
Show or hide the caps lock warning given the status

#### setConfirmationField

`void setConfirmationField ( passwordField )`
Set this field as the confirmation for the targeted password field:

Parameters:
  `passwordField <inputEx.PasswordField>` The target password field

#### setOptions

`void setOptions ( options )`
Add the password regexp, strengthIndicator, capsLockWarning

Parameters:
  `options <Object>` Options object as passed to the constructor

#### updateStrengthIndicator

`void updateStrengthIndicator ( )`
Update the strength indicator (called by onKeyPress)

#### validate

`void validate ( )`
The validation adds the confirmation password field support

#### Methods inherited from inputEx.Field:

`clear, close, destroy, disable, displayMessage, enable, fireUpdatedEvt, focus, getEl, getParentField, getState, getStateString, getValue, hide, initEvents, isDisabled, isEmpty, onBlur, onChange, onFocus, render, renderComponent, setClassFromState, setFieldName, setOptions, setParentField, setValue, show, validate`

#### Methods inherited from inputEx.StringField:

`disable, enable, focus, getStateString, getValue, initEvents, isDisabled, onFocus, renderComponent, setClassFromState, setFieldName, setOptions, setValue, validate`

#### Events inherited from inputEx.Field:

`updatedEvt,`

Copyright © 2010 Eric Abouaf All rights reserved.