Reputation: 22257
Is there any equivalent of the errorPlacement for the validPlacement in jQueryValidation?
My goal is to add the valid class to another element.
Thanks.
Upvotes: 3
Views: 2037
Reputation: 22257
I solved the problem using success option.
var validatorOptions = {
success: function(label) {
var element = '#' + label.attr('for');
$(element).addClass('myClass');
}
};
Upvotes: 2
Reputation: 18572
You can write a custom validation function. A custom validation function takes 2 arguments: value and element
That gives you access to the element parameter.
Upvotes: 0