Author: Karen Stanley

1. Introduction

This document specifies all the behaviors of the Password Box component necessary for the control to be complete and delightful to use. This document is not meant to define the APIs or architecture. The goal of the specification is to ensure that we can deliver and validate UI components that are consistent, usable, appealing and sufficiently customizable to succeed in today's market. 

The Password Box is a field that allows users to specify a password. It is often used to allow users to create accounts, log in (or "sign in") to a web page or application, and is used in the process of changing a password. Passwords are used for security purposes. Only users who provide the correct password may gain access to a given user's information on the site or in the application. This is critically important for sites and applications that provide access to confidential information such as financial, medical, or human resources information.

 

2. Password Box Overview

When in use, the Password Box replaces entered text with a mask character for security reasons. An example Password box is shown below in the enabled state, (using the Caspian visual style). The example below shows the Password Box with a label, which is typical on the desktop platform.


labeled, enabled password box
Figure 1: Enabled Password Box control (Caspian visual style)


There are three main use cases for this control. Each of these use cases is identified below with a description of the most common interactions performed within each use case.
Note that in the use cases described below, when users enter their password, possible options for input include typing, pasting, or selecting characters, depending on the platform on which they are working and the context/use case in which they are working. 


Log In:
Users will use the Password Box when providing the password associated with their account name or user ID when logging into a web page or application. Users typically enter their password and then submit it along with their account name/user ID for validation and to be used as part of account authentication and eventual access to information.they are authorized to see and potentially work with.


Create Account:
When creating an account, users typically need to provide a password that must be used when logging into the web page or application for which the account was created (see the above use case). Users enter the password into one Password Box and then into a second in order to confirm the password. Once all account information has been entered, it is usually submitted for validation and account creation.


Change Password:
At times, users may wish to change the password associated with an account. In order to do this users typically must first enter their existing password. Then they enter a new password and then re-enter their new password to confirm it. 

One may also know this control by the name: Password Field.

3. Password Box: Desktop

3.1 Desktop - Introduction

On the desktop users may enter passwords by typing them or pasting them into the Password box. 

Different sites/applications and use cases may have different requirements regarding the ability to paste a password into a Password Box field. For this reason, the Password Box control must be configurable so developers have the option to allow this capability or not.

 

3.2 Desktop - Visual Design

The following image shows the password box in its three possible states: Normal (Enabled), Focused, and Disabled. 

password box in 3 states - caspian style
Figure 2: Enabled (Normal), Focused, Disabled Password Box controls (Caspian visual style)

For more visual design details see the Caspian Visual Design Style for JavaFX, sections 4:11 Text Box and 4:12 Password Box.

 

3.3 Desktop - Detailed Behaviors

Detailed behaviors associated with the Password Box in its three possible states are described below.

Enabled:

 password box enabled state
Figure 3: Enabled Password Box control (Caspian visual style)


When the password box is enabled, it displays a mask character for any characters that have been entered. If no characters have been entered, it is blank. The control is ready to receive focus.


Focused:

 password box, focused with I-beam cursor 
Figure 4: Focused Password Box control (Caspian visual style)


When the Password Box receives focus, by being tabbed to or clicked in, its border is shown highlighted. When tabbing into the control any existing text is selected, where when clicking into the control, the I-beam cursor is inserted into the existing text where clicked. If there is no existing input, the cursor is placed at the left side of the control. When the I-beam cursor is displayed it is positioned at the next input location. (The above image shows that the user has entered eight characters and the I-beam curser waits for the 9th.)


Behaviors when in Focused State:

For every character that is input, it is displayed in the Password Box control for the number of seconds indicated by the developer (specified in the Actual Character Display Time attribute) and then replaced with the mask character. This gives the user the chance to verify what they have entered before continuing.Note, however, that if another character is input before the actual character display time completes, the display of the actual entered character is abandoned and the character is replaced with the mask character at the time the next character is input.

Allowing users to see the actual entered character is not as important on the desktop as it is on other platforms such as Mobile and TV, but some developers may elect to allow the characters to be seen briefly.

When users are done entering a password, they typically indicate this by pressing the Enter key while focus is in the control. (Other ways the user may do this are by tabbing out of the control or clicking on another control.) When this happens, the Password Box control returns the entered password and all application control to the calling application which would then be responsible for determining what action to take next. The Password Box would remain in focused state until the calling application moves the focus. The mask characters would remain displayed in the control by default. Possible actions that the controlling application may take at this point include:
    - move focus to the next control, waiting to validate until the entire page is submitted for validation.
    - validate password immediately, display an error message and re-call Password Box so the password may be corrected
    - validate password immediately  and place focus on the next appropriate UI control
    - validate password immediately and invoke the default Button 


Other behaviors:

Lock Indication - Visual Design

Get the CapsLock and NumLock icons from here.

 

Password Strength Indication - Visual Design

 

State NameDescriptionVisual Appearance
EnabledControl is displayed. Any existing input is replaced with a mask character.(The number of mask characters to display - or just what to display - may be developer-controlled post-1.3.) password box enabled state
 Figure 9: Enabled Password Box control (Caspian visual style)
FocusedControl is ready for input. A mask character is displayed for each character that is input by the user. (The actual character may be displayed briefly before mask character is displayed.) password box, focused with I-beam cursor I-beam cursor blinks at input location.
 Figure 10: Focused Password Box control (Caspian visual style)
DisabledControl cannot accept input or be navigated to. password box, disabled state
  Figure 11: Disabled Password Box control (Caspian visual style)

 

 

3.4 Desktop - Keyboard Support

 

3.4.1 Windows Keyboard Support

 

KeyInitial StateResult
EscPassword Box is in Enabled state.No change.
Mouse button 1(Left Mouse button)Password Box is in Enabled state.Password Box is in Focused state.
Mouse button 2 (right mouse buttonPassword Box is in Enabled state.If a context menu is associated with this control, it is displayed.
TabPassword Box is in Enabled state.Tab to this control puts the Password Box in Focused state.
Tab from this field returns entered password and control to the calling application. (Typically the calling application would move focus from the Password Box to the next UI control).
Shift Tab Shift-Tab to this control puts the Password Box in Focused state.
Shift-Tab from this field returns entered password and control to the calling application. (Typically the calling application would move focus from the Password Box to the previous UI control).
Control TabPassword Box is in Focused state.Entered password and control is returned to the calling application. (Typically the calling application would remove focus from the Password Box control. It may be that Ctrl is ignored and Tab is invoked. Web pages may select next page Tab. Etc.)
Control Shift TabPassword Box is in Focused state.Entered password and control is returned to the calling application. State of the control would be governed by the calling application. (Typically the calling application would remove focus from the Password Box control. It may be that Ctrl is ignored and Shift-Tab is invoked. Web pages may select precious page Tab. Etc.)
Enter/returnPassword Box is in Focused state.Entered password and control is returned to the calling application. State of the control would be governed by the calling application.
SpacebarPassword Box is in Focused state.Enters a space character as part of the password. The space character may or may not displayed for some period of time. The designated mask character is then displayed.
Left, Right, Up, Down arrow keysPassword Box is in Focused state.
  • If nothing has been entered in field, all arrow keys result in no change.
  • Up and Down arrow keys move up or down one line if control height is multiple lines tall. Typically for Password Box, the height will be only one line in which case, the Up and Down arrow keys would result in no change.
  • If text has been entered Left and Right arrow keys move left and right among the entered text. The Left arrow key results in no change when the cursor is positioned to the left of the first entered character. The Right arrow key results in no change when the cursor is positioned to the right of the last entered character.
CAPS LOCKPassword Box is in Enabled or Focused state.If CAPS LOCK key is on, a visual indicator is displayed on right of (but within, if possible) the Password Box control. If not, the indicator is not shown. (This feature may be turned off. See 3.5 Desktop - Attributes below.) CAPS LOCK makes it such that the shift characters on the keyboard are input into the Password Box control (e.g. any alphabetic character selected is entered as a capital letter) until this key is selected again, turning it off.
any alphanumeric keys and special charactersPassword Box is in Focused state.Enters these characters as part of the password. They may or may not be displayed for some period of time. The designated mask character is then displayed.

3.4.2 MAC Keyboard Support

Keyboard behaviors are the same as for Windows keyboard support.

 

3.4.3 Linux Keyboard Support

Keyboard behaviors are the same as for Windows keyboard support.

 

3.5 Desktop - Attributes

Below is a table indemnifying the attributes required by the Password Box control.

Note that the Password Box will inherit attributes of the Text Box control including:

Particular to Password Box will be the following:   

Attribute NameDescriptionDefaultValid Values
Mask CharacterThis is an optional attribute. The character displayed in the Password Box field that masks the actual characters the user enters.A bullet character or symbol.
If there are any issues with rendering a good-looking, appropriately sized bullet, use an asterisk (*) as a backup.
Any character.
Actual Character Display TimeThis allows the developer to set the amount of time to display the actual input character before replacing it with the mask character.

Note, however, that if another character is input before the actual character display time completes, the display of the actual entered character is abandoned and the character is replaced with the mask character at the time the next character is input.
0 secondsPositive Integers (for now - - we may find that we need to be more granular)
Not for 1.3
Minimum Characters
This is an optional attribute. If provided, the Password Box will provide a visual indicator that the password is not valid until the minimum number of characters has been entered.Null (No minimum.)Positive Integer
Not for 1.3
Maximum Characters
This is an optional attribute. If provided, the Password Box will stop accepting input when the maximum number of characters has been entered.Null. (No maximum.)Positive Integer
Not for 1.3
Sound Beep After Max Characters
This is an optional attribute that allows the developer to elect to have a sound (beep) produced when the user tries to enter more than the maximum number of allowed characters. (Only works if a maximum has been specified.)Boolean False
(No sound is produced when user types past the max number of allowed characters.)
Boolean True or False
Not for 1.3
Turn On CAPS LOCK Indicator
This is an option to allow developers to choose to display the CAPS LOCK indicator when the user engages CAPS LOCK.Boolean True
(CAPS LOCK indicator is displayed when CAPS LOCK is engaged.
Boolean True or False
Not for 1.3
Display Password Strength
This is an optional attribute which turns on the display of a password strength indicator.Boolean False.
(Password Strength not displayed.)
Boolean True or False

4. Password Box: Touch

 

4.1 Touch - Introduction

The Mobile Touch platform introduces some additional considerations not seen on the desktop:

 

4.2 Touch - Visual Design

* All Password Box images on the Touch platform should be considered placeholders. Actual visual design will be provided by our Visual Design team.

The following image shows the Password Box in its three possible states: Normal (Enabled), Focused, and Disabled.
(They are based on the Text Field control that runs on the desktop platform (it is the same code running). Of course, the dimensions are adjusted to accommodate the mobile device.)

password box in 3 states - caspian style
Figure 12: Enabled (Normal), Focused, and Disabled Password Box controls (Caspian visual style - check with visual designers to see if adjustments are needed for Touch)

 

4.3 Touch - Detailed Behaviors

Below is a description of the behaviors and interactions pertaining to the Password Box on the Touch platform.

Note that this specification assumes the invocation and use of an on-screen keyboard for text input.

The potential use cases applicable to the Touch platform are similar to the use cases for Desktop:

Applicable states are also similar to the Desktop: EnabledFocused and Disabled.

Detailed behaviors associated with the Password Box in its three possible states are described below.


Enabled:

 password box enabled state
 Figure 13: Enabled Password Box control (Caspian visual style - check with visual designers to see if adjustments are needed for Touch)

When the password box is enabled, it displays a mask character for any characters that have been entered. (The number of mask characters to display - or just what to display - may be developer-controlled post-1.3.) If no characters have been entered, it is blank. The control is ready to receive focus.



Focused:

 password box, focused with I-beam cursor 
 Figure 14: Focused Password Box control (Caspian visual style - check with visual designers to see if adjustments are needed for Touch)

When the Password Box receives focus, by being tapped (with finger or stylus), it is shown highlighted. The I-beam cursor blinks at the next input location. When the field receives focus, a keyboard also typically appears. (The above image shows that the user has entered eight characters and the I-beam curser waits for the 9th.)


Behaviors when in Focused State: 

As users tap the keys on the keyboard there is visual feedback on the characters (varies by platform) and there is also input into the Password Box control. Selected characters are displayed in the Password Box control for the number of seconds indicated by the developer (specified in the Actual Character Display Time attribute) and then replaced with the mask character. This gives the user the chance to verify what they have entered before continuing. Note, however, that if another character is input before the actual character display time completes, the display of the actual entered character is abandoned and the character is replaced with the mask character at the time the next character is input.

Displaying the actual character is especially important on Touch platforms that don't use a standard QWERTY keyboard where it is less predictable that the user has entered the character they expected. 

To correct an incorrect selection, the user chooses the keyboard key that allows deletion of the input to the left of the I-beam cursor, typically the backspace key.


Here is an example using a keyboard with multiple characters available per touch button:

* All Password Box images on the Touch platform should be considered placeholders. Actual visual design will be provided by our Visual Design team.

mobile passwrod box using non-querty keyboard
Figure 15: Example of Password Box control with on-screen keyboard (Caspian visual style for control - check with visual designers to see if adjustments are needed for Touch)

Other examples layouts of mobile touch keyboards are shown below:

mobile keyboard examplemobile keyboard examplemobile keyboard example

Figure 16: Example showing three possible on-screen keyboard layouts 

When the user has finished entering the password, the Enter (or whatever button the keyboard provides to indicate "finished") button can be tapped. This dismisses the keyboard. (Another means to dismiss the keyboard would be to click an icon on the bottom bar or on another component in an (native) application, which doesn't allow text input.) At this point, the Password Box control returns the entered password and all application control to the calling application which would then be responsible for determining what action to take next. The Password Box would remain in focused state until the calling application moves the focus. The mask characters would remain displayed in the control by default. (Note that the number of mask characters to display - or just what to display - may be developer-controlled post-1.3.) Possible actions that the controlling application may take at this point include:
    - move focus to the next control, waiting to validate until the entire page is submitted for validation.
    - validate password immediately, display an error message and re-call Password Box so the password may be corrected
    - validate password immediately  and place focus on the next appropriate UI control
    - validate password immediately and invoke the default Button on the page.

Other behaviors:


Disabled:

 password box, disabled state
 Figure 19: Disabled Password Box control (Caspian visual style - check with visual designers to see if adjustments are needed for Touch)

Although it may be unusual for this control to appear in a disabled state, it is plausible that a site or application may want to disable the Password Box control. One example may be that the control is disabled until an account name or user ID is entered. 

In the disabled state, the Password Box is "grayed out" (details are governed by the visual design specification being used) to indicate that is cannot receive input. Any input already entered is displayed using a "grayed out" mask character. (The number of mask characters to display - or just what to display - may be developer-controlled post-1.3.) The control does not accept focus when tapped and cannot otherwise be navigated to.



States:
The following table identifies the applicable states pertaining to the Password Box control.

State NameDescriptionVisual Appearance
EnabledControl is displayed. Any existing input is replaced with a mask character.(The number of mask characters to display - or just what to display - may be developer-controlled post-SoMa.) password box enabled state
 Figure 20: Enabled Password Box control (Caspian visual style -check with visual designers to see if adjustments are needed for Touch)
FocusedControl is ready for input. A mask character is displayed for each character that is input by the user. (The actual character may be displayed briefly before mask character is displayed.) password box, focused with I-beam cursor I-beam cursor blinks at input location.
 Figure 21: Focused Password Box control (Caspian visual style -check with visual designers to see if adjustments are needed for Touch)
DisabledControl cannot accept input or be navigated to. password box, disabled state
Figure 22: Disabled Password Box control (Caspian visual style -check with visual designers to see if adjustments are needed for Touch)

 

4.4 Touch - On-Screen Keyboard Support

This section describes keys & key behavior when using an on-screen keyboard. The keys identified here are considered to be common across keyboards, though keyboard keys and layout tend to vary.

On-Screen Keyboard Notes: 
  - Tapping a key once selects the left-most primary (large) item displayed on a key with multiple items.
  - Tapping two times in quick succession selects the item to the right of the left-most item; three times moves to the right of that.
  - Tapping Shift and then another key selects the secondary (smaller - and usually a top) item on the key.
  - Tapping the '123' item toggles the on-screen keyboard to a numeric keyboard.

KeyInitial StateResult
Enter/ReturnPassword Box is in Focused state.

The on-screen keyboard is dismissed. (Another means to dismiss the keyboard would be to click an icon on the bottom bar or on another component in an (native) application, which doesn't allow text input.) The entered password and control is returned to the calling application. State of the control would be governed by the calling application.

<- (backspace)Focused StateDeletes the character to the left of the I-beam cursor in the Password Box control.
SpacebarPassword Box is in Focused state.Enters a space character as part of the password.The space character may or may not displayed for some period of time. The designated mask character is then displayed.
CAPS LOCK (if available on the on-screen keyboard))Password Box is in Focused state.Turns on CAPS LOCK. The on-Screen keyboard should display some visual indicator that CAPS LOCK is "on". The Password Box control itself will not provide any indication of CAPS LOCK being on. CAPS LOCK makes it such that the shift characters on the keyboard are input into the Password Box control (e.g. any alphabetic character selected is entered as a capital letter) until this key is selected again, turning it off (and removing the visual cue from the keyboard).
any alphanumeric keys and special charactersPassword Box is in Focused state.Enters these characters as part of the password. They may or may not be displayed for some period of time. The designated mask character is then displayed.

 

4.5 Touch - Attributes

Below is a table indemnifying the attributes required by the Password Box control on the Touch platform.

Note that the Password Box will inherit attributes of the Text Box control including:

Particular to Password Box will be the following:   

Attribute NameDescriptionDefaultValid Values
Mask CharacterThis is an optional attribute. The character displayed in the Password Box field that masks the actual characters the user enters.A bullet character or symbol.
If there are any issues with rendering a good-looking, appropriately sized bullet, use an asterisk (*) as a backup.
Any character.
Actual Character Display TimeThis allows the developer to set the amount of time to display the actual input character before replacing it with the mask character.

Note, however, that if another character is input before the actual character display time completes, the display of the actual entered character is abandoned and the character is replaced with the mask character at the time the next character is input.
0 secondsPositive Integers (for now - - we may find that we need to be more granular)
Not for 1.3
Minimum Characters
This is an optional attribute. If provided, the Password Box will provide a visual indicator that the password is not valid until the minimum number of characters has been entered.Null (No minimum.)Positive Integer.
Not for 1.3
Maximum Characters
This is an optional attribute. If provided, the Password Box will stop accepting input when the maximum number of characters has been entered.Null. (No maximum.)Positive Integer
Not for 1.3
Sound Beep After Max Characters
This is an optional attribute that allows the developer to elect to have a sound (beep) produced when the user tries to enter more than the maximum number of allowed characters. (Only works if a maximum has been specified.)Boolean False
(No sound is produced when user types past the max number of allowed characters.)
Boolean True or False
Not for 1.3
Display Password Strength
This is an optional attribute which turns on the display of a password strength indicator.Boolean False.
(Password Strength not displayed.)
Boolean True or False