Hi all.
I'm developing a validation system which involves custom events
handling. That is, I want to execute some code before the validation
and some code after the validation.
So, my `$.fn.validate` looks like this (simplified):
$.fn.validate = function(callback) {
return this.each(function() {
var res;
var $this = $(this);
$this.trigger("beforeValidate");
res = validationExecution(); // edited to simplify
$this.trigger("afterValidate", [res]); // <-- look at this line
});
};
Trouble is, while the `$("something").trigger("event", data)` allows
passing extra data to the handler (as seen inside `$.fn.trigger` and
`$.event.trigger`), the handler function receives just a param, which
is the real-or-fake event.
Reason to want this feature is that the `afterValidate` handler must
know if the validation has been succesfull to proceed in one of two
manner (succesfull/unsuccesfull).
Any workaround for this? Should I create a ticket?
--
Choan
<http://choangalvez.nom.es/>
Dizque. Desarrollo web y pequeñas dosis de vida real
<http://dizque.lacalabaza.net>
Mundo Du. Cuentos breves, relatos sorprendentes
<http://du.lacalabaza.net/>
Scriptia. Javascript y buenas prácticas
<http://scriptia.net/>
_______________________________________________
jQuery mailing list
[email protected]
http://jquery.com/discuss/