jquerytools/jquerytools — Issue #653: Add a onSelectAll event handler for Validator
Author: alibby251
Created: 2012-02-04 19:59:51+00:00
State: open
Labels: Feature Request, Fix posted, Validator

See issue 649 - this is the base code to use:

Tested and found to work, via issue 649:
```
$("#id").validator({ // CODE }).bind("onSuccess", function(e, els) {
// CHECK FOR ALL VALIDATION
var numSucceeded = els.length,
numExpected = $(this).data('validator').getInputs().length;
// IF ALL VALIDATION HOLDS TRUE
if (numSucceeded === numExpected) {
//CODE
}
```
Another example - not tested:
```
// get handle to the Validator API
var api = $("#myform").data("validator");
// use API to assign an event listener
api.onSuccess(function(e, els) {
var FormFieldCount = 7;
if ( els.length != FormFieldCount ) { return false; };
alert ( 'All form fields passed with success' );
return false;
});
```