Custom Error Label Placement using jQuery validate (For all or some of your errors)

后端 未结 4 1826
执笔经年
执笔经年 2020-12-12 14:07

I would like to place one error label (Not All) in a custom location. jQuery provides this http://docs.jquery.com/Plugins/Validation/validate#toptions optio

4条回答
  •  孤街浪徒
    2020-12-12 15:05

    Actually its not necessary to use any javascript code for this, and I discovered a simple solution. You can force JQuery Validate to place the validation error in a DOM element.

    For example, JQuery generates an error like this:

     
    

    You can place this label dom element in your next td block or li element or whatever you want as a blank like this.

    
    

    JQuery will find that blank field and place the error message for you.

    Just don't forget the for field in label element!

提交回复
热议问题