[jQuery] [validate] Refreshing the validator after dynamically adding a class to an element

[jQuery] [validate] Refreshing the validator after dynamically adding a class to an element


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?