1

The example of errorPlacement in the validation plugin section of jquery.com gives this example:

error.appendTo( element.parent("td").next("td") );

Which adds the error to the "td" after the input. I am trying to do a similar thing but I am not using "td" elements.

This is what my HTML looks like:

<p><label>Employee Number:</label><input type="text" name="eenum" id="eenum" class="required" /><span></span></p>

I am trying to get the error to appear in the "span" after the input, but nothing I have been trying works correctly. If the error appears at all, it is always preceding the input.

1 Answer 1

1

So, what did you try? It should be

error.appendTo(element.next("span"));
Sign up to request clarification or add additional context in comments.

3 Comments

Thanks for your interest in this. I've tried that and it still puts the error before the input. If I try error.appendTo(element.after('aaa')); It will put the 'aaa' where I want the error message to go, but that's as far as I've gotten.
Are you maybe using floats or other measures to position the inputs? It works in a minimal environment: jsfiddle.net/e3UaC
Thanks for the input, it seems that this may be more of a CSS problem.

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.