PasswordStrengthChecker demo

This page show a passwordStrengthChecker Mixin.
This Mixin can be used to evaluate the strength of password strings.

The mixin displays an instantaneous visual feedback related to the complexity of the password.
You have to provide your own rules to evaluate the password strength.
This demo page use Client-side mode.

Notice the javascriptChecker parameter that identify the Javascript function used client-side to check the password complexity.
According to the documentation, the dummyChecker must return an element of JS Exanpe.PasswordStrengthChecker.Complexity enum.

In Action

TML Source code

			<input type="password" t:type="passwordfield" t:id="pwd" 
				   t:mixins="exanpe/PasswordStrengthChecker" t:javascriptChecker="dummyChecker" 
				   value="password" />
		<script type="text/javascript">
			Tapestry.onDOMLoaded(function() {
				dummyChecker = function(password) {
					var strength = "";
					if (password.length == 1)
						strength = Exanpe.PasswordStrengthChecker.Complexity.VERY_WEAK;
					if (password.length == 2)
						strength = Exanpe.PasswordStrengthChecker.Complexity.WEAK;
					if (password.length == 3)
						strength = Exanpe.PasswordStrengthChecker.Complexity.STRONG;
					if (password.length > 3)
						strength = Exanpe.PasswordStrengthChecker.Complexity.STRONGEST;
					return strength;
			// -->

Java code

    	private String password;