jQuery Validate is not executing while using Unobtrusive Validation

二次信任 提交于 2019-11-29 08:47:00

If you're using the Unobtrusive Validation plugin, then you cannot also call jQuery Validate's .validate() method.

Why?

  1. The Unobtrusive Validation plugin automatically constructs the .validate() method based on the various data attributes in your form.

  2. The jQuery Validate plugin does not allow the .validate() method to be called more than once on the same form. So since you're already using Unobtrusive Validation to construct .validate(), your other call to .validate() will be totally ignored.

Please use the required attribute instead

<input type="password" required>
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!