Disable required validation by JavaScript

前端 未结 7 855
半阙折子戏
半阙折子戏 2020-12-19 02:11

I have a create form to create an object. The create model has some properties that are only visible (.hide, .show()) if a checkbox is checked and that are marked required (

7条回答
  •  一生所求
    2020-12-19 03:06

    The unobtrusive javascript plugin provided by MVC doesn't process the data properties on the fly. Instead, it parses the results on document ready and caches them.

    Try calling $.validator.unobtrusive.parse(myForm) on your form after modifying the property in question to see if it gives you expected results.

提交回复
热议问题