Strong Password Example #3

In this example we are chaning the values of what is strong, and for the weak text, changing the default text.


With this example, we define the CSS styles the same as as with the first strong password example. The difference is that we now configure the strong password object upon initialization.

CSS Code:

The CSS styles are the same as in the first example.

JavaScript Code:

This simple example just shows that one can place HTML code within the text for the error messages, so that you can emphasize (or demphasize) different areas.

Some of the default values to define the strength have also been changed.

  1. var sp = null;
  2. function init() {
  3.     sp = new StrongPassword({
  4.             allowSpecialChars: true,
  5.             minWeakScore: 6,
  6.             minIntermediateScore: 9,
  7.             scoreTextWeak: 'make it <strong>STRONGER</strong>',
  8.             source: 'pwphrase'
  9.         });
  10. }