Monday, February 21, 2011

Error placement in jQuery

I used the following code for error placement in my jQuery code. It's working but it shows error exactly after the input element but I want to place the error message exactly below the input element so how can I accomplish this job? Is there a function present insertBelow linke function i used insertAfter?

how to place an error message for a group of check box an group of radio buttons?

errorPlacement: function(error, element) {
   if ( element.is(":radio") )
    error.insertAfter( element.parent().next() );
   else 
    error.insertAfter( element);
  }

Wainting for your replys!

Thank you!

From stackoverflow
  • Keep in mind that in html you don't have "below" or "above" tags/elements, to achieve that you either use a display: block css property (with no width specified) so the element takes all the available space or include a linebreak at the beginning of string you are inserting.

0 comments:

Post a Comment