Disable required validation by JavaScript

前端 未结 7 856
半阙折子戏
半阙折子戏 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 02:52

    Unobstrusive validation looks for this attribute data-val="true"

    I guess, that if you do a $('#mycheckbox').data('val','false'), the validation will skip a item with that id.

    Probably there is a more appropriate way to do it, but if not, take this.

    cheers.

提交回复
热议问题