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 undefined
http://.../jquery.validate.js
Line 76

..which is this line:

var validator = jQuery(this[0].form).validate();


Any suggestions?

Thanks,
Jason



Reply via email to