Add Rules On Dynamic Form

前端 未结 2 818
迷失自我
迷失自我 2021-01-26 13:19

I\'m trying to add validation rules on a form that is dynamically populated, depending on a JSON response from a back-end. I\'m using jQuery 1.9.1 and jQuery Validation plugin.<

相关标签:
2条回答
  • 2021-01-26 13:46

    Where is .validate()?

    You cannot call plugin method rules("add") until sometime after the plugin has been initialized with .validate().

    0 讨论(0)
  • 2021-01-26 13:57

    I think the error is thrown from the validator plugin,

    var settings = $.data(element.form, "validator").settings;

    May be the 'id' is not referred properly.

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