Centralize some error messages from my form

前端 未结 2 1103
-上瘾入骨i
-上瘾入骨i 2021-01-25 02:46

Currently, I\'m using errorPlacement to print error message for each input :

$(\'#my_form\').validate({
    errorPlacement: function(error, element)         


        
2条回答
  •  一向
    一向 (楼主)
    2021-01-25 03:22

    Something like using showErrors only for inputs that I want to centralize, then errorPlacement for the others.

    One will always over ride the other.

    You'll have to use showErrors for everything, where you inspect the errorMap and errorList and conditionally place each message where you need it.

提交回复
热议问题