3

Is there any equivalent of the errorPlacement for the validPlacement in jQueryValidation?

My goal is to add the valid class to another element.

Thanks.

1
  • 2
    You can use "success" option. Commented Apr 5, 2011 at 11:35

2 Answers 2

2

I solved the problem using success option.

var validatorOptions = {    
    success: function(label) {
        var element = '#' + label.attr('for');
        $(element).addClass('myClass');
    }
};
Sign up to request clarification or add additional context in comments.

Comments

0

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.

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.