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?
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?
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);
}
});