>What's the rationale behind the validate plugin only handling one
>jQuery object?  This doesn't seem consistent with how jQuery works at
>all.

The validator() object breaks the jQuery chain and returns a reference to
the current validator object. This allows you to build code to interact with
the validator--which is necessary at times.

Also, not all jQuery methods with multiple selectors. For example the val()
method only returns the value from the first element found.

So while the validator() method may not work like most methods, it's not
unusual for a method to not return the chain or work with more than 1
element.

>The website states:
>Validating multiple forms on one page: The plugin can handle only one
>form per call. In case you have multiple forms on a single page which
>you want to validate, you can avoid having to duplicate the plugin
>settings by modifying the defaults via $.validator.defaults. Use
>$.validator.setDefaults({...}) to override multiple settings at once.
>
>But I have a serious problem with this...  first off, I don't want to
>validate every form on my page.  I have a number of widgets that
>utilize forms that don't need validation on the client side.  What I
>would love is to be able to do something like:
>
>$('form.classOfForms').validate({....});

Personally, I've never seen a need to apply the exact same validation rules
to multiple forms. Each form I design generally has very distinct rules for
validation.

What are you doing that would require multiple forms to be validated with
the exact same validation rules?

-Dan


Reply via email to