jQuery Validate is not executing while using Unobtrusive Validation

前端 未结 2 2105
南笙
南笙 2020-12-18 13:41

I\'m using ASP.NET MVC and I have jQuery, jQuery validate, jQuery validate.config, jQuery validate unobtrusive, unobtrusive ajax and other libraries in my bundle. I have a f

相关标签:
2条回答
  • 2020-12-18 13:55

    Please use the required attribute instead

    <input type="password" required>
    
    0 讨论(0)
  • 2020-12-18 13:57

    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.

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