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 7570265
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 30, 20262026-05-30T15:22:43+00:00 2026-05-30T15:22:43+00:00

i am trying to provide client side validation for password using jquery, but the

  • 0

i am trying to provide client side validation for password using jquery, but the form gets submitted without validating. i am new to jquery as well.

what i am trying here
1)checking for the password fields, should be not null
2)comparing both the passwords.
but the form gets submitted, and i could not find the error.

Please help

<!DOCTYPE HTML>
<html>
        <head>
        <title>Form Example</title>
        <script type="text/javascript" src="jquery-1.7.1.js"></script>
        <script type="text/javascript" src="http://ajax.microsoft.com/ajax/jquery.validate/1.7/jquery.validate.min.js"></script>
        <script type="text/javascript" src="jquery.form.js"></script>
        <script type="text/javascript">
            $(document).ready(function(){
                $("#myform").validate({
                    //onkeyup: false;
                    debug: true;
                    rules: {
                        password: {
                            required: true,
                            minlength: 6,
                            maxlength: 12,
                            password: true
                        },
                        password1: {
                            required: true,
                            equalTo: "#password"
                        }
                    },

                    messages: {
                        password: {
                            required: "req",
                            minlength: "min",
                            maxlength: "max"
                         }
                        password1: {
                            required: "req re",
                            equalTo: "not equal"
                        }
                    }
                });
            });
        </script>
        <style>
            label.error { width: 250px; display: inline; color: red;}
        </style>
    </head>
    <body>
        <form name="myform" id="myform" action="" method="POST">
            <label for="password">Choose a password</label>
            <input type="text" name="password" id="password" value="" />
            <label for="password" generated="true" class="error"></label>

            <br/>

            <label for="password1">Retype password</label>
            <input type="text" name="password1" id="password1" value="" />
            <label for="password1" generated="true" class="error"></label>

            <br/>
            <input type="submit" value="join" />
            <input type="submit" value="cancel" class="cancel" />
        </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-05-30T15:22:45+00:00Added an answer on May 30, 2026 at 3:22 pm

    Make the following changes to your validate function and it’ll work fine

    1) Remove the line debug: true;
    2) You have missed a comma in the messages section. Add a comma to after the first message, as follows…

    messages: {
        password: {
            required: "req",
            minlength: "min",
            maxlength: "max"
        },
        password1: {
            required: "req re",
            equalTo: "not equal"
        }
    }
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

Trying to do client and server side validation I have 2 files. The client
I'm trying to provide a link to my company's website from a Windows Form.
I am trying to provide my own labelFunction for a CategoryAxis programatically but am
I'm trying to use ThreadLocal to provide thread safety to pre-existing non-thread-safe classes, but
I'm working on a little side app for a client whereby they provide me
I am trying to upload files to a web server using System.Net.WebClient.UploadFile but I
I'm trying to enable service discovery in my client-server application using JmDNS. I fully
I'm trying to create a client side app in javascript that downloads a sqlite
I'm trying to lay out an idea for a project, where a client-side GUI
I am trying to provide a simple RESTful API to my ASP MVC project.

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.