Centralize some error messages from my form

前端 未结 2 1104
-上瘾入骨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.

    0 讨论(0)
  • 2021-01-25 03:35

    You can use text-align:center; property in css.

    0 讨论(0)
提交回复
热议问题