Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • Home
  • SEARCH
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 8605065
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 12, 20262026-06-12T02:43:55+00:00 2026-06-12T02:43:55+00:00

Hello I am working on a javascript that is suppose to test the password

  • 0

Hello I am working on a javascript that is suppose to test the password field. However I can’t seem to get it to work. Nothing bad happens the page loads but seems like the script isn’t working. Here is what I have written up so far. I want it to check for a Upper and lower case letter, a number and a non-regular expression. Lenght isn’t important just that it has one of each. Here is what I have written so far.

UPDDATE: Found a simplier way of writing the script. And I can get it to give me a alert whenever the password field is wrong. But I can’t get the true statements to work to where it will do the document button click.

var str= passwordFieldForm;
    var patt=/[a-z]/g;
    var patt2 = /[A-Z]/g; 
    var patt3 = /[0-9]/g; 
    var patt4 = /[~\!@#\$%\^&*_\-\+=`\|\\(\)\{\}\[\]:;"'<>,\.\?\/]/g; 

    var result=patt.test(str);
    var result2=patt2.test(str);
    var result3=patt3.test(str);
    var result4=patt4.test(str);

    if (!result)
      alert("Needs a lowercase letter");

    if (!result2)
      alert("Needs a Uppercase Letter")

    if (!result3)
      alert("Needs a Number.")

    if (!result4)
      alert("Needs a special character")


    if (result) && (result2) && (result3) && (result4) == true
      document.getElementById("kioskform:broswerPasswordSubmit").click();
  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-12T02:43:56+00:00Added an answer on June 12, 2026 at 2:43 am

    This might be a bit closer to what you want, I’ve not tested it, but it should be more in the right direction:

    function test(password)
    {
        var patt1 = /[a-z]/g;
        var patt2 = /[A-Z]/g;
        var patt3 = /[0-9]/g;
        var patt4 = /[~\!@#\$%\^&*_\-\+=`\|\\(\)\{\}\[\]:;"'<>,\.\?\/]/g;
    
        if (!patt1.test(password)) {
            return ("You need a lowercase letter.");
        }
    
        if (!patt2.test(password)) {
            return ("You need an uppercaseletter.");
        }
    
        if (!patt3.test(password)) {
            return ("You need a number.");
        }
    
        if (!patt4.test(password)) {
            return ("You need to use a one of the following characters '~!@#$%^&*_-+=`|\(){}[;.");
        }
    }
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

Hello I am working on a javascript that is supposed to test the password
Hello all I am working in javascript and html5.I want to ask that how
I have a small chunk of code I can't seem to get working. I
Hello I've been working on a Javascript 8 slider puzzle (that is working including
I am working on a PHP app that requires eight javascript files (hello web2.0).
Hello all I am working on javascript jquery and svg.I want to ask a
Hello all I am working on html and javascript.And I am going to ask
Hello I'm working on a problem that requires me to change an set array
Hello I have this list that i am working on. When i move the
Hello everybody my linq to sql selection does not working on dateTime field for

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.