One other thing that's bothering me about the validate plugin...
first, for the record I want to clarify that I really do like this
plugin - I find it especially useful.  I am unable to have a form
object and call validate() on it more then once.  For the most part
this makes sense, but I have an instance right now where to cut on how
much code I re-use I would like to be able to append more validation
rules to the form that I am working with.  It would be nice if some
how there was an attribute or something which allowed me to append
rather than over-write (granted, the over-write functionality would
still need to be preserved by default).


On Jul 18, 9:27 am, "Dan G. Switzer, II" <[EMAIL PROTECTED]>
wrote:
> >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