Josh Nathanson schrieb:
- onsubmit: Boolean, default true - validate on form submit (similar
to onkeyup/onblur)
- beforeValidation: Callback, called before doing any validation
- beforeSubmit: Callback, called before submitting the form (default
submit or calling submitHandler, if specified)
I'm not sure yet if beforeValidation should be called only for the
entire form or also when validating a single element. Opinions?
That all sounds good, and just want to add my vote for
"onValidationFailure" to be run if the validation fails on the submit
action (in other words form() == false). Or, is this covered in your
new callbacks and I'm not quite following?
Nope, that wasn't included. I see the point though.
Does it make more sense to run that before displaying error messages, or
afterwards? How to name it? beforeErrorDisplay? afterValidation?
beforeFailure?
I'd like to stick with jQuery's naming conventions: $.ajax provides
beforeSend (would be beforeValidation), success (beforeSubmit?), error
(onValidationFailure?)
I may also need to rename the option "errorPlacement". It should be
errorHandler: Like submitHandler, if specified, it replaces built-in
funcitonality. In contrast to the beforeWhatever callbacks, which are
just called but have no effect on the validation lifecycle.
Does that make sense? What would you prefer? beforeValidation, success
and error? Or beforeValidation, beforeSubmit, afterError? Other suggestions?
-- Jörn