Note that there are some explanatory texts on larger screens.

plurals
  1. POsubstitut for equalTo() method in jquery validate
    primarykey
    data
    text
    <p>I am using <strong>jQuery Validate Plugin</strong> now and have some problem with it.</p> <p>My html:</p> <pre><code>&lt;div class="card"&gt; &lt;div class="item"&gt; &lt;span class="label"&gt;&lt;b class="red"&gt;*&lt;/b&gt;CardNo:&lt;/span&gt; &lt;input class="BankCardNo" name="BankCardNo" type="text" value=""/&gt; &lt;/div&gt; &lt;div class="item"&gt; &lt;span class="label"&gt;&lt;b class="red"&gt;*&lt;/b&gt;Confirm CardNo:&lt;/span&gt; &lt;input class="ConfirmCardNo" name="ConfirmCardNo" type="text" value=""/&gt; &lt;/div&gt; &lt;/div&gt; &lt;div class="card"&gt; &lt;div class="item"&gt; &lt;span class="label"&gt;&lt;b class="red"&gt;*&lt;/b&gt;CardNo:&lt;/span&gt; &lt;input class="BankCardNo" name="BankCardNo" type="text" value=""/&gt; &lt;/div&gt; &lt;div class="item"&gt; &lt;span class="label"&gt;&lt;b class="red"&gt;*&lt;/b&gt;Confirm CardNo:&lt;/span&gt; &lt;input class="ConfirmCardNo" name="ConfirmCardNo" type="text" value=""/&gt; &lt;/div&gt; &lt;/div&gt; </code></pre> <p>I am making <em>Bankcard Manage Page</em>. one can add several cards at a time. <br/> I want to make every card validate separately, but <code>equalTo</code> method only accept element id,name,attr<br></p> <p>such as </p> <pre><code>$("#myForm").validate({ rules: { "Password": { required: true, }, "ConfirmPassword": { required: true equalTo: '#Password' } }, errorElement: "div" }); </code></pre> <p>this is validate plugin add rules, it's very beautiful.<br> so I just want all validation codes like this. this is the main problem.</p> <p>If I write code like below, it can't find the correct CardNo......</p> <pre><code>$('.card').find('.ConfirmCardNo').rules('add', { required: true, equalTo: '.CardNo' }); </code></pre> <p>how I achieve my purpose?</p>
    singulars
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload