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

  • SEARCH
  • Home
  • 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 8606665
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 12, 20262026-06-12T03:09:12+00:00 2026-06-12T03:09:12+00:00

I am working on a regular expression to check the password field, Now the

  • 0

I am working on a regular expression to check the password field, Now the javascript that tests the varible is working, but when I try to call it and check the form I can’t seem to get the javascript to see that I want it to check the password in the form with the javascript I made but I can’t seem to get the form to commnuicate with the javascript I made, The form and the javascript are on the same page, what I want for it to do is after it checks the password requirements it will just go and submit the form. Here is what I have so far.

<html>
 <body>
    <script type="text/javascript">
     function checkPassword(password)
    {
    password = document.getElementById('thethePasswordFieldField').value;   
        var patt=/[a-z]/g;
        var patt2 = /[A-Z]/g; 
        var patt3 = /[0-9]/g; 
        var patt4 = /[~\!@#\$%\^&*_\-\+=`\|\\(\)\{\}\[\]:;"'<>,\.\?\/]/g; 

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

                if (!result)
            alert("Needs a lowercase & uppercase letter, a number & a special character.");

                if (!result2)
            alert("Needs a lowercase & uppercase letter, a number & a special character.");

                if (!result3)
            alert("Needs a lowercase & uppercase letter, a number & a special character.");

                if (!result4)
            alert("Needs a lowercase & uppercase letter, a number & a special character.");

                        if (result && result2 && result3 && result4)
            alert("");
            document.getElementById('frmApplication').submit();
    }
    </script>

    <form id="frmApplication" name="frmApplication" action="test.html" method="post">
    Password: <input type="text" name="thethePasswordFieldField" id="thethePasswordFieldField">  
   <a href="javascript:checkPassword()">Submit</a>
   </form>
    </body>
    </html>
  • 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-12T03:09:13+00:00Added an answer on June 12, 2026 at 3:09 am

    You’re using getElementById but have not actually assigned an ID attribute to the “password” field.

    Try:

    <input type="password" name="thePasswordField" id="thePasswordField"/>
    

    The reason I suggest using this convention is to avoid using “password” as your actual field name (IE will probably die if you use this method) and to also of course, actually use a password type field.

    Hopefully it should be obvious to you that your initial getElementById line must refer to the “thePasswordField” ID value.

    I have not vetted the rest of your code, but put the ID attribute in there and give it a shot.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I'm having some trouble translating my working C# regular expression into JavaScript's regular expression
I've got a working regular expression, but I'd like to make it a tad
I have the following regular expression working in sed but I want to retain
I'm relativly new to regular expressions but I managed to create a working expression
Im working in a php form where Im validating the feilds with regular expression.
I have such a regular expression: re.compile(r"((https?):((//)|(\\\\))+[\w\d:#@%/;$()~_?\+-=\\\.&]*)", re.MULTILINE|re.UNICODE) But that doesn't include hashbangs (#!)
I am working with regular expression in python, need an expression which will check
Hello I am working on a javascript that is suppose to test the password
I am working on writing a Perl-compatible regular expression in PHP to check whether
Recently programming in PHP, I thought I had a working Perl regular expression but

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.