Give that a try: .toggleClass("required") In your approach, its likely that the metadata isn't picked up, so you'd have to manually remove the cached metadata, via .data("metadata", null)
Jörn On Tue, Aug 11, 2009 at 3:06 AM, Jean-Michel<jean-michel.godin-dug...@voluzion.ca> wrote: > > Hi, > > I know the refresh() method is gone since version 1.2 but for some > reason even if it's suposed to work without it I can't get it to work. > > Here's the scenario: > > I got a select box, depending on the selection I want certain element > to validate so I dynamically add validation class to those element > like this. > > $("input#element").toggleClass("{validate:{required:true}}"); > > But when I click submit the element doesn't get validated at all but I > can see the class has been added in firebug. > > Any clues what could be the problem? >