The valid()-method fails when its called without any element selected.
So in your case, one of these two selectors seems to find nothing:
$('.reqPC')  $('.reqPA')

Jörn

On Fri, May 16, 2008 at 5:34 PM, Jason Huck <[EMAIL PROTECTED]> wrote:
>
> p.s., I was using a slightly older version of the plugin, but updating
> to the latest made no difference. The rest of the validation (and
> there's quite a bit of it) is all working just fine.
>
> - jason
>
>
>
> On May 16, 11:09 am, Jason Huck <[EMAIL PROTECTED]> wrote:
>> I'm using Jörn's awesome Validate plugin and have accidentally broken
>> something.
>>
>> I have two radio buttons in a fieldset like so:
>>
>> <fieldset id="meta26group">
>> <input id="meta26_3" class="required digits" type="radio" value="3"
>> name="meta26"/>
>> <label for="meta26_3">Stuff</label><br/>
>> <input id="meta26_5" class="required digits" type="radio" value="5"
>> name="meta26"/>
>> <label for="meta26_5">Other Stuff</label><br/>
>> </fieldset>
>>
>> They are inside this form:
>>
>> <form id="addproduct" class="content productform" method="post"
>> action="./" accept-charset="utf-8" >
>>
>> Depending on which of these radio buttons is checked, certain other
>> fields are required. So, in addition to the main call to $
>> ('#addproduct').validate(), I have these two snippets:
>>
>> $.validator.addClassRules({
>>         reqPC: { required: '#meta26_5:checked' },
>>         reqPA: { required: '#meta26_3:checked' }
>>
>> });
>>
>> $('#meta26group input').click(function(){
>>         $('.reqPC').valid();
>>         $('.reqPA').valid();
>>
>> });
>>
>> When I first set all of this up, it worked beautifully, but somewhere
>> along the way, I broke it. Now when I click on either radio button, I
>> get this:
>>
>> this[0] is undefinedhttp://.../jquery.validate.js
>> Line 76
>>
>> ..which is this line:
>>
>> var validator = jQuery(this[0].form).validate();
>>
>> Any suggestions?
>>
>> Thanks,
>> Jason
>

Reply via email to