jQuery Validation not working in Bootstrap 4

后端 未结 1 1734
南笙
南笙 2020-12-11 12:59

I am trying to implement form validation with Bootstrap 4 and JQuery-validation, but can\'t seem to make it work.

My form is displayed as a Modal dialog as shown nex

相关标签:
1条回答
  • 2020-12-11 13:21

    None of your input elements contain a name. If you want to use this plugin, any element considered for validation must contain a name attribute and when declaring rules via the rules object, this name is referenced, not the id.

    See the docs:

    "Mandated: A 'name' attribute is required for all input elements needing validation, and the plugin will not work without this. A 'name' attribute must also be unique to the form, as this is how the plugin keeps track of all input elements."

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