开发者

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 t开发者_运维百科o 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!


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

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜