[jQuery] Error on validation plugin documentation?
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html>
<head>
</head>
<body bgcolor="#ffffff" text="#000000">
Hi, I'm tryng for the first time the validation plugin, I was looking
at the doc here:
<a class="moz-txt-link-freetext" href="http://docs.jquery.com/Plugins/Validation/validate">http://docs.jquery.com/Plugins/Validation/validate</a>
In the "invalidHandler" sample code there is:
<pre><a href="http://docs.jquery.com/Core/%24" title="Core/$">$</a>(".selector").<strong
class="selflink">validate</strong>({
invalidHandler: function(form) {
var errors = validator.numberOfInvalids();
</pre>
This gave me an error (validator is not defined), and reading the
explanation above this code there is:
Callback for custom code when an invalid form is submitted. Called
with a event object as the first argument, and the validator as the
second.
Then I changed the code in :
<pre>
<a href="http://docs.jquery.com/Core/%24" title="Core/$">$</a>(".selector").<strong
class="selflink">validate</strong>({
invalidHandler: function(form, <b>validator</b>) {
var errors = validator.numberOfInvalids();
</pre>
and now it works.
I have an account on the jquery site, but before editing some code I
don't know, I ask here if my suggestion is right...
Bye
<pre class="moz-signature" cols="72">--
gianiaz.net - web solutions
via angelo custode, 10 - 23100 sondrio (so) - italy
+39 347 7196482
</pre>
</body>
</html>