inputEx Documentation Back to homepage

### inputEx Documentation > inputEx.PasswordField 0.2.2

## Static 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)

### Methods

#### getPasswordStrength

`static getPasswordStrength(pw)`
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
Parameters:

`pw`

#### getStateString

`getStateString(state)`
Change the state string
Parameters:

`state`

#### onInput

`onInput(e)`
Update the state of the confirmation field
Parameters:

`e <Event>` - The original input event

#### onKeyPress

`onKeyPress(e)`
callback to display the capsLockWarning
Parameters:

`e`

#### onKeyUp

`onKeyUp(e)`
onkeyup callback to update the strength indicator
Parameters:

`e`

#### renderComponent

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

#### setCapsLockWarning

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

`status`

#### setConfirmationField

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

`passwordField <inputEx.PasswordField>` - The target password field

#### setOptions

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

`options <Object>` - Options object (inputEx inputParams) as passed to the constructor

#### updateStrengthIndicator

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

#### validate

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

#### Methods inherited from class inputEx.StringField:

`initEvents, updateTypeInvite, getValue, disable, enable, setValue, onFocus, focus, setClassFromState,`

Copyright (c) 2007-2009 Eric Abouaf. All rights reserved.
Generated by JsDoc Toolkit 2.0.0 on Wed, 04 Mar 2009 15:41:31 GMT using neyricjslibs-template.