MVC 3 unobtrusive validation - conditionally disable/enable validation

前端 未结 2 1520
无人及你
无人及你 2020-12-20 22:44

I have a form that has an option to enter dimensions for:

  • Width & Height
  • Width
  • Height

And I have two container div

2条回答
  •  春和景丽
    2020-12-20 23:18

    So it seems that this is the answer to my question (I went hunting again on Google hard to search for things that didn't relate to "hidden" fields):

    https://stackoverflow.com/a/7673985/491950

    e.g.

    $("#height-container input[type='text']").attr("disabled", "disabled");
    

    Thanks for your answers.

提交回复
热议问题