This page provides examples of the password widget capabilities.
In the first example, there is a password widget that checks if the field is not empty, when the password is required. The validation event can be 'onChange' - this means the validation will be triggered as you type. 'onBlur' - when the password field loses focus, and validation 'onSubmit' - when the form is submitted. All Spry Validation widgets validate onSubmit. 'onBlur' and 'onChange' are options.
The password validation widget can have conditions to increase the password complexity. This example contains a password validation widget that has to receive a minimum 6 characters and maximum 20 characters to pass the validation.
Using the password validation widget, you can define your own password strength by adding a combination of conditions.
In the first password example below you can have: a maximum 20 characters (any kind of character: number, special chars, etc.), but there should be a minimum of 3 Alphabetical (alpha) chars and maximum 6 Alpha characters to be a valid password.
The next password field uses min/maxUpperAlphaChars (any alpha character in upper case).
You can add conditions to the password field to force a min/max number of numeric characters and also a min/max number of special characters, as you can see in the last two examples of this section.
This example shows how to disallow special characters and numbers for your password.
You can also use a fixed number of characters for password by specifying the same value for min and max options.
To pass the validation in this example, the password should have at least: 2 number characters, 2 alpha characters in upper case and one Special character. The maximum length should be between 8 and 10 characters.The second input in this section is the password confirmation. To use this functionality you have to use the Confirm Validation Widget.
You can set an additional error message for the password widget in case you want to give more intuitive details to the user about what should be filled in.
The following example shows how to change the default appearance for the error messages, by over-writing the default css classes.