Solved

Password validation 2 Alpha and at least 2 Numeric

Posted on 2004-08-10
5
391 Views
Last Modified: 2013-12-18
I am new to javascript and need to check if a password field has at least 2 alpha and 2 numeric

Here is my script to check for at least one of each but how do I change it to check for at least 2

 if(!theForm.Password.value.match(/^([a-z]+[0-9]+[a-z0-9]*)|([0-9]+[a-z]+[a-z0-9]*)$/i)){
     alert("Password has to have at least one number and one letter character.");
     theForm.Password.focus();
     return false;
  }
return true;

thanks
0
Comment
Question by:guestsl
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 2
  • 2
5 Comments
 
LVL 46

Accepted Solution

by:
Sjef Bosman earned 125 total points
ID: 11770278
I think you 're better off with two separate matches, something like these regexp's:

    match(/[a-zA-Z].*[a-zA-Z]/)
    match(/[0-9].*[0-9]/)

Anyway, if this doesn't help, ask Community Support to move your question form this Notes TA to the JavaScript Topic Area.
0
 
LVL 31

Expert Comment

by:qwaletee
ID: 11778391
You need to use a bracket notation that includes all the possible characters [0-9A-Za-z]
0
 
LVL 31

Expert Comment

by:qwaletee
ID: 11778396
BTW, why are you asking this in a Lotus Notes forum?
0
 

Author Comment

by:guestsl
ID: 11779402
I asking in the Notes Forum because the javascript is on in a Domino Database on a form used to allow users to reset thier password.

I will also ask in the Javascript forum

thanks for your advice so far
0
 

Author Comment

by:guestsl
ID: 11780404
Thanks for your advice a have manged to get the javascript to work all ok thanks for pointing me in the direction of the Javascript forum that helped a lot
0

Featured Post

Free Tool: Subnet Calculator

The subnet calculator helps you design networks by taking an IP address and network mask and returning information such as network, broadcast address, and host range.

One of a set of tools we're offering as a way of saying thank you for being a part of the community.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

I thought it will be a good idea to make a post as it will help in case someone else faces these issues. I trust this gives an idea how each entry in Notes.ini can mean a lot for the Domino Server to be functioning properly. This article discusses t…
For beginners of Lotus Notes user this is important to know about the types of files and their location supported by IBM Notes. Mostly users are unaware about how many file types are created and what their usages are. This Article is fully dedicated…
If you're a developer or IT admin, you’re probably tasked with managing multiple websites, servers, applications, and levels of security on a daily basis. While this can be extremely time consuming, it can also be frustrating when systems aren't wor…
NetCrunch network monitor is a highly extensive platform for network monitoring and alert generation. In this video you'll see a live demo of NetCrunch with most notable features explained in a walk-through manner. You'll also get to know the philos…

707 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question