[jQuery] Re: using depends method with Validate() plugin

2008-12-03 Thread Jörn Zaefferer
See http://docs.jquery.com/Plugins/Validation/Reference#Fields_with_complex_names_.28brackets.2C_dots.29 Jörn On Wed, Dec 3, 2008 at 6:58 PM, luke adamis <[EMAIL PROTECTED]> wrote: > > Thanks, > That did it. > Now I have another issue: > > these checkboxes must be names like an array: > > produc

[jQuery] Re: using depends method with Validate() plugin

2008-12-03 Thread luke adamis
Thanks, That did it. Now I have another issue: these checkboxes must be names like an array: product_interest[] but in the rules I can't have this: product_interest[]: "required", I know I can insert code in HTML: class="required" but I would rather have it i

[jQuery] Re: using depends method with Validate() plugin

2008-12-03 Thread Jörn Zaefferer
I guess you have to escape that ID: jQuery interprets that as "element with id product_interest and an attribute named '0'". Jörn On Wed, Dec 3, 2008 at 5:24 PM, luke adamis <[EMAIL PROTECTED]> wrote: > > Is there a reason for this to not work? > >other_product_interest: {

[jQuery] Re: using depends method with Validate() plugin

2008-12-03 Thread luke adamis
Is there a reason for this to not work? other_product_interest: { required: "#product_interest[0]:checked" }, product_interest[] is a list of checkboxes, if user picks 'other' , #product_in

[jQuery] Re: using depends method with Validate() plugin

2008-12-02 Thread luke adamis
Thanks! I found the page as well: http://docs.jquery.com/Plugins/Validation/Methods/required#dependency- expression I wonder how I could miss this page. Luke On Dec 2, 2008, at 2:05 PM, Jörn Zaefferer wrote: Either depends: "#countrycode[value=1]" or depends: function() { return $("#count

[jQuery] Re: using depends method with Validate() plugin

2008-12-02 Thread Jörn Zaefferer
Either depends: "#countrycode[value=1]" or depends: function() { return $("#countrycode").val() == '1'; } Jörn On Tue, Dec 2, 2008 at 8:42 PM, luke adamis <[EMAIL PROTECTED]> wrote: > > OK > > this works: > >current_password: { >minl

[jQuery] Re: using depends method with Validate() plugin

2008-12-02 Thread luke adamis
OK this works: current_password: { minlength: 6, required: { depends: "#new_password:filled" }