0

placing an error after an input box is simple and makes sense... but what if the error relates to a radio group and that group is within a table?

I want the error to show up after the table...

Any idea how to accomplish this?

2
  • Are you using the validation plugin? Commented Oct 18, 2010 at 22:04
  • Yes I am. I'm trying to figure out the best way to attach the error to the next occurring ".error-trigger" class. Commented Oct 18, 2010 at 22:15

1 Answer 1

1

You can use .closest() to get the <table> it's in, then place the error .after() that, for example:

$("form").validate({
  errorPlacement: function(error, element) {
    element.closest('table').after(error);
  }
});
Sign up to request clarification or add additional context in comments.

1 Comment

Wow. Okay... I didn't even think to look for the "table". Thank you sir. Now everything looks nice and clean!

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.