Note that there are some explanatory texts on larger screens.

plurals
  1. PO
    primarykey
    data
    text
    <p>As per <a href="http://flowplayer.org/tools/validator/index.html" rel="nofollow">the documentation</a>:</p> <blockquote> <p>The second argument is a jQuery object containing all fields that passed the validation.</p> </blockquote> <p>So, in your <code>onSuccess</code> callback, you just need to check the <code>length</code> of <code>els</code> (the second argument) and make sure it's equal to the total number of fields you're validating.</p> <hr> <p>I think this should work (but I haven't tested it):</p> <pre><code>$(document).ready(function() { $("#leadbanker_intake_form").validator({ position: 'center right', offset: [0, 0], message: '&lt;div&gt;&lt;em/&gt;&lt;/div&gt;' }).bind("onSuccess", function(e, els) { var numSucceeded = els.length, numExpected = $(this).data('validator').getInputs().length; if (numSucceeded === numExpected) { // get your Ajax on } } }); </code></pre> <hr> <p><strong>Edit:</strong> In your comment below, you said that if you use this code:</p> <pre><code>$(document).ready(function() { $("#leadbanker_intake_form").validator({ position: 'center right', offset: [0, 0], message: '&lt;div&gt;&lt;em/&gt;&lt;/div&gt;' }).bind("onSuccess", function(e, els) { var numSucceeded = els.length, numExpected = $(this).data('validator').getInputs().length; if (numSucceeded === numExpected) { $("#leadbanker_intake_form").submit(function() {} } } }); </code></pre> <p>then the code just seems to be ignored. I see two problems with that.</p> <p>First, that code is syntactically incorrect - you're missing two close parens (the code on your question was already missing one, and I forgot to add that one in). To fix the syntax, that code should be this:</p> <pre><code>$(document).ready(function() { $("#leadbanker_intake_form").validator({ position: 'center right', offset: [0, 0], message: '&lt;div&gt;&lt;em/&gt;&lt;/div&gt;' }).bind("onSuccess", function(e, els) { var numSucceeded = els.length, numExpected = $(this).data('validator').getInputs().length; if (numSucceeded === numExpected) { $("#leadbanker_intake_form").submit(function() {}); // &lt;-- here } }); // &lt;-- and here }); </code></pre> <p>Note the semicolons you missed as well. I'm not sure if these syntax errors exist in the actual code you're trying to run, or if that was a transcription error on your part, but it's definitely a serious enough syntax error to break the whole thing.</p> <p>The other problem is that <code>.submit(...)</code> call binds a submit listener, <strong>if</strong> the form validated. However - and I'm not sure of this part - your form may have already submitted by the time you bind that <code>submit</code> handler. The solution to that problem is to bind the listener outside of the <code>onSuccess</code> callback. The other possibility regarding this (I really need to read over the jQuery TOOLS docs...) is that you need to manually submit the form - that is, you might be successfully binding the handler, <em>but the form's never actually submitting</em>!</p> <p>I really can't say much more without looking a the TOOLS docs, and maybe your actual code as well. If the suggestions in this edit don't fix the problem for you, would you mind posting a <a href="http://jsfiddle.net" rel="nofollow">jsfiddle</a> or a <a href="http://jsbin.com" rel="nofollow">jsbin</a> that reproduces the problem?</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.
    1. VO
      singulars
      1. This table or related slice is empty.
    2. VO
      singulars
      1. This table or related slice is empty.
    3. VO
      singulars
      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