jQuery-Validation-Engine icon indicating copy to clipboard operation
jQuery-Validation-Engine copied to clipboard

onValidationComplete triggered via ('validate') on field

Open eruvio opened this issue 12 years ago • 0 comments

Within validate: function() (line 107), the onValidationComplete callback is fired and the 2nd parameter should be boolean representing if the form is "valid"

The variable "valid" is passed as the 2nd parameter of the callback. _validateField() gets it's value from "return options.isError". This value should be negated when passed to the onValidationComplete callback because the parameter is supposed to reflect whether the form isValid.

I am using select2 and calling manually triggering the validationEngine('validate') on the original select element.

Additionally, I believe _onSubmitEvent() should trigger an additional hook, separate from onValidationComplete, so one can easily distinguish between field validate() and form submissions. Alternatively, passing the individual element to onValidationComplete() rather than the form. I am currently detecting the type of validation trigger by doing var jqv = $(form).data('jqv'); if(jqv.eventTrigger == 'submit' && status) from onValidationComplete()

eruvio avatar Jul 18 '14 14:07 eruvio