0

So, I basically want to do something like this: http://jsfiddle.net/bUV6S/1/ ...

But I want to do it using the validate.js. Is it possible to target multiple textboxes using:

            errorPlacement: function (error, element) {
                error.appendTo($("#textUsername"));
            }

...in some way? Thanks.

2 Answers 2

1

You can append to multiple elements like this:

error.appendTo("#textUsername, #textPassword");

Here is the documentation link for "Multiple Selectors": http://api.jquery.com/multiple-selector/

Here is a jsfiddle appending to multiple elements: http://jsfiddle.net/jasper/Wa8EA/

Sign up to request clarification or add additional context in comments.

Comments

0

Have you tried making all of the things you wish to append to in the same css someclass and using a class selector? error.appendTo(".someclass"); ?

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.