complex/nested tags inside wrapper

complex/nested tags inside wrapper

Hi all,

I'm having trouble setting up the validator plugin in a form. The form has a table (displaytag). One of the columns inside the table is a textbox that must be validated.

I have setup the validate plugin and it works fine. The problem comes when I try to place the error message in a line below the ofending line. For this to be achieved correctly I need to enclose the label inside both a tr and td tags. I have tried using the wrapper option, but with it I can only add one of the two.

Adding a single tag "td colspan='number of columns'" does the trick in firefox but microsoft IE (which is more strict in terms of table display) does not show the error line because the corresponding tr is missing.

Is there a syntax that will alow nested tags inside the wrapper option? ... am I tackling the problem from the wrong point of view?

This is the code of my validate method:

  1.                 var validator = $('#myForm').validate({
                        wrapper: "td colspan=7 width=100% align=right",
                        errorPlacement: function(error, element) {
                            var parentElement = element.parent().parent();
                            if (parentElement.hasClass('oddTr')) {
                                error.addClass('oddTr');
                            } else {
                                error.removeClass('oddTr');
                            }
                            error.insertAfter(parentElement);
                        }
                    });











Any hint on how achieving this would be much appreciated.

Cheers,

Alex.