[jQuery] Re: [validate] Possible to add form validation logic in multiple places?

2008-05-25 Thread Jörn Zaefferer
I don't yet have a good idea of your setup, so just a quick idea: // somewhere before the other stuff var validationOptions = {}; // set page specifc options $.extend(validationOptions, { ... }); // generated $(...).validate(validationOptions); That would work with and without page-specific

[jQuery] Re: [validate] Possible to add form validation logic in multiple places?

2008-05-25 Thread Doug Mayer
This should be a pretty good solution for what I need. Thanks Jörn! On May 25, 7:54 am, Jörn Zaefferer [EMAIL PROTECTED] wrote: I don't yet have a good idea of your setup, so just a quick idea: // somewhere before the other stuff var validationOptions = {}; // set page specifc options

[jQuery] Re: [validate] Possible to add form validation logic in multiple places?

2008-05-25 Thread Doug Mayer
Trying to implement this now... Working off of what you said, is there a way to do something like this? var validationOptions = { rules: { name: { required: true } } }; $.extend(validationOptions, { rules: { email: { required: true } } }); And get a validationOptions with both? Or will I need

[jQuery] Re: [validate] Possible to add form validation logic in multiple places?

2008-05-25 Thread Jörn Zaefferer
You can do a deep extend - its still undocumented, but stable since 1.2.6: $.extend(true, validationOptions, { rules: { email: { required: true } } }); Jörn On Sun, May 25, 2008 at 6:25 PM, Doug Mayer [EMAIL PROTECTED] wrote: Trying to implement this now... Working off of what you said, is

[jQuery] Re: [validate] Possible to add form validation logic in multiple places?

2008-05-25 Thread Doug Mayer
This did the trick, exactly what I needed. Thanks! On May 25, 12:22 pm, Jörn Zaefferer [EMAIL PROTECTED] wrote: You can do a deep extend - its still undocumented, but stable since 1.2.6: $.extend(true, validationOptions, { rules: { email: { required: true } } }); Jörn On Sun, May 25,