Solved

Password validation 2 Alpha and at least 2 Numeric

Posted on 2004-08-10
5
383 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
  • 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: Site Down Detector

Helpful to verify reports of your own downtime, or to double check a downed website you are trying to access.

One of a set of tools we are providing to everyone 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

Suggested Solutions

Title # Comments Views Activity
Lotus notes view not working using Trim 14 210
Lotus Domino server 11 67
IBM Notes How to read an encrypted mail saved as .eml file 7 58
problem with deleted user 14 28
You’ve got a lotus Domino web server, and you have been told that “leverage browser caching” is a must do. This means that we have to tell the browser everywhere in the web to use cache. In other words, we set (and send) an expiration date in the HT…
This article covers general Notes 8.5 troubleshooting information including recreating the Notes\Data folder.
Although Jacob Bernoulli (1654-1705) has been credited as the creator of "Binomial Distribution Table", Gottfried Leibniz (1646-1716) did his dissertation on the subject in 1666; Leibniz you may recall is the co-inventor of "Calculus" and beat Isaac…
In a recent question (https://www.experts-exchange.com/questions/29004105/Run-AutoHotkey-script-directly-from-Notepad.html) here at Experts Exchange, a member asked how to run an AutoHotkey script (.AHK) directly from Notepad++ (aka NPP). This video…

830 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