Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations SkipVought on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Checking Password is in LowerCase 1

Status
Not open for further replies.

thomsons

Programmer
Dec 16, 2002
19
0
0
GB
I've just started using JavaScript and I am trying to validate that when someone is changing their password in the system that it is a certain length and also that it has been input in LowerCase.

I've got the length part to work by using the following:-

if(elmNewPwd1.value.length > 16){.......etc

if(elmNewPwd1.value.length < 8){........etc

Please can someone point me in the right direction for checking that the New Password has been input in lowercase.

Thanks in advance,
S.
 
Code:
if (elmNewPwd1.value != elmNewPwd1.value.toLowerCase()){.......etc
 
if(elmNewPwd1.value.toLowerCase == elmNewPwd1.value)
alert (&quot;password is in lowercase&quot;);
else if (elmNewPwd1.value.toUpperCase == elmNewPwd1.value)
alert (&quot;password is in uppercase&quot;);
else
alert (&quot;password is in mixed case&quot;);

Water is not bad as long as it stays out human body ;-)
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top