Hi, to solve my problem I had to change the idorName function in jquery.validate:
idOrName: function(element) { if (element.type != "hidden") { return this.checkable(element) ? element.name : element.id || element.name; } if($("input[name='"+element.name+"'][type='radio']").length > 0){ return element.name; } }, and created a new method in additonal-methods: jQuery.validator.addMethod("chosen", function(value, element) { if(value != ""){ return true; } if($("input[name='"+element.name+"']:checked").length > 0){ return true; } return false; }, "Select an option"); I thought this might help someone, and possibliy be added to a new release of the jquery.validate. Sebastian On Apr 22, 1:31 pm, Jörn Zaefferer <[EMAIL PROTECTED]> wrote: > sebastian schrieb: > > > Hi, the problem i have is that I have a group of radio buttons > > associated with a hidden field like this: > > > <input type="hidden" name="data[User][gender]" value="" > > id="UserGender_" /> > > <input type="radio" name="data[User][gender]" id="UserGenderF" > > value="f" /> > > <label for="UserGenderF">Female</label> > > <input type="radio" name="data[User][gender]" id="UserGenderM" > > value="m" /> > > <label for="UserGenderM">Male</label> > > > and I have the following validation rule for the element: > > > "data[User][gender]":"required" > > > the validation doesn't work , it always shows an error whether the > > radio buttons are selected or not. > > > Please help. > > The required-method doesn't support mixed types. In your setup, only the > hidden field is validated, which is always invalid. > > You could implement a custom required-method for this case. Take a look > at the current required-implementation for reference validating the > group of radio buttons. > > Jörn