For example, create a folder called SpryAssets in the root folder of your web site, and move the SpryValidationPassword.js file to it. The SpryValidationPassword.js file contains all of the information necessary for making the Password widget interactive.
<script src="SpryAssets/SpryValidationPassword.js" type="text/javascript"></script>
Make sure that the file path to the SpryValidationPassword.js file is correct. This path varies depending on where you’ve placed the file in your web site.
<link href="SpryAssets/SpryValidationPassword.css" rel="stylesheet" type="text/css" />
Make sure that the file path to the SpryValidationPassword.css file is correct. This path varies depending on where you’ve placed the file in your web site.
<input type="password" name="fieldName" value="" />
<span id="PasswordWidget"> <input type="password" name="fieldName" value="" /> </span>
<script type="text/javascript"> var pw1 = new Spry.Widget.ValidationPassword("PasswordWidget"); </script>
Make sure that the ID of the Password widget’s container span tag matches the ID parameter you specified in the Spry.Widgets.ValidationPassword method. Make sure that the JavaScript call comes after the HTML code for the widget.
The complete code looks as follows:
<head> ... <script src="includes/SpryValidationPassword.js" type="text/javascript"></script> <link href="includes/SpryValidationPassword.css" rel="stylesheet" type="text/css" /> ... </head> <body> ... <span id="PasswordWidget"> <input type="password" name="fieldName" value="" /> </span> <script type="text/javascript"> var pw1 = new Spry.Widget.ValidationPassword("PasswordWidget"); </script> ... </body>