views:

22

answers:

1

I'm using jquery Validation. I am trying to control where the error message will appear.

How can i do that?

10x

+1  A: 

You could use the errorPlacement method:

$("#myform").validate({
    errorPlacement: function(error, element) {
        error.appendTo(element.parent("td").next("td"));
    }
});
Darin Dimitrov
this isn't in a table format . can i do that in a div with an id?
Of course you can. I just posted a sample which you could adapt to your scenario. You can append the error wherever you like.
Darin Dimitrov
i try thiserror.appendTo($("DIVID"));didnt work
How about `$("#DIVID")`?
Darin Dimitrov