Wrox Home  
Search P2P Archive for: Go

  Return to Index  

javascript thread: Password Validation


Message #1 by "Shaukat Desai" <shaukat.desai@g...> on Thu, 23 Nov 2000 12:24:06 -0000
This is a multi-part message in MIME format.

------=_NextPart_000_0315_01C05868.2382ED80
Content-Type: text/plain;
	charset="iso-8859-1"
Content-Transfer-Encoding: quoted-printable

hi,

 function isNumber(e)
 {
  var valids =3D "1234567890"
  for (var i=3D0 ; i < e.length ; i++ )
  {
   if (valids.indexOf(e.charAt(i)) =3D=3D -1 ) return false;
  }
 }

modify this script and add all the characters that you want to allow as 
entries in the valids list.
just now it allows only numbers. if u want to allow characters, make it

var valids =3D "1234567890abcdefghijklmnopqrstuvwxyz";

and before comparing the "e", convert it into "lower case" as
tmpe =3D e.toLowerCase();

jigs


  ----- Original Message -----
  From: Shaukat Desai
  To: javascript
  Sent: Thursday, November 23, 2000 5:54 PM
  Subject: [javascript] Password Validation


  Does anyone how a script which checks if a value entered in a password
  txtbox is Alphnumeric?

  Thanks in advance


  ---
  NEED TECHNICAL TIPS, TOOLS, AND INSIGHTS?  Is FREE okay?
  Visit EarthWeb for the latest in IT Management, Software Development,
  Web Development, Networking & Communications, and Hardware & Systems.  

  Click on http://www.earthweb.com for FREE articles, tutorials,
  and discussions from the experts.
$subst('Email.Unsub')





  Return to Index