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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 10, 20262026-06-10T13:53:21+00:00 2026-06-10T13:53:21+00:00

I am using jQuery Validate Plugin now and have some problem with it. My

  • 0

I am using jQuery Validate Plugin now and have some problem with it.

My html:

<div class="card">
    <div class="item">
        <span class="label"><b class="red">*</b>CardNo:</span>
        <input class="BankCardNo" name="BankCardNo" type="text" value=""/> 
    </div>
    <div class="item">
        <span class="label"><b class="red">*</b>Confirm CardNo:</span>
        <input class="ConfirmCardNo" name="ConfirmCardNo" type="text" value=""/>
    </div>
</div>
<div class="card">
    <div class="item">
        <span class="label"><b class="red">*</b>CardNo:</span>
        <input class="BankCardNo" name="BankCardNo" type="text" value=""/> 
    </div>
    <div class="item">
        <span class="label"><b class="red">*</b>Confirm CardNo:</span>
        <input class="ConfirmCardNo" name="ConfirmCardNo" type="text" value=""/>
    </div>
</div>

I am making Bankcard Manage Page. one can add several cards at a time.

I want to make every card validate separately,
but equalTo method only accept element id,name,attr

such as

$("#myForm").validate({
  rules: {
    "Password": {
      required: true,
    },

    "ConfirmPassword": {
      required: true
      equalTo: '#Password'
    }
  },

  errorElement: "div"
});

this is validate plugin add rules, it’s very beautiful.
so I just want all validation codes like this.
this is the main problem.

If I write code like below, it can’t find the correct CardNo……

$('.card').find('.ConfirmCardNo').rules('add', {
  required: true,
  equalTo: '.CardNo'
});

how I achieve my purpose?

  • 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-10T13:53:23+00:00Added an answer on June 10, 2026 at 1:53 pm

    you can do it like this

    var $elems = $('.card');
    
    (function fetch(i) {
        if(i >= $elems.length) return;  // no elems left
    
        var $elem = $elems.eq(i);
    
        $($elem).find('.ConfirmCardNo').rules('add',{ 
            required:true, 
            equalTo:$($elem).find('.CardNo')
        });
    
        fetch(i + 1);  // next one
    
      })(0);  // start with first elem
    

    or if you want to use only one plugin

    you can loop through all the card div’s and make rule based on their values

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

Sidebar

Related Questions

I'm using the jQuery validate() plugin for some forms and it goes great. The
I m using jquery validator plugin. i need to validate some field with some
I'm using the jQuery Validation plugin on my forms. I have some groups of
I'm using the jQuery plugin Validation to validate a form. I have a select
I am using jquery.validate.js plugin for a dialog validation. My problem is that I
I'm using the jQuery Validate plugin on my demo page and for some reason
[UPDATED] I'm using JQuery Validate plugin to validate a simple form. It's form HTML:
I have been using jquery validate plugin http://bassistance.de/jquery-plugins/jquery-plugin-validation/ . It has been working successfully,
I am using jquery validation plugin to validate my form. Now the validation can
I have some forms that I am validating with jQuery Validate plugin. The next

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.