javascript Validate Password

function ValidatePassword(strString){
   var strValidChars = "abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789-_ ";
   var strChar;
   var blnResult = true;

   if (strString.length < 6) return false;

   for (i = 0; i < strString.length && blnResult == true; i++)
      {
      strChar = strString.charAt(i);
      if (strValidChars.indexOf(strChar) == -1)
         {
         blnResult = false;
         }
      }
   return blnResult;
}
Validates a Password according to a list of valid characters.

Updated: Friday 1st October 2010, 15:42pm

There are 0 comments

Leave a comment of your own

Comments are currently closed.