dynamically remove an element's required attribute in ASP MVC?
问题 Is there a way, in an ASP MVC project using unobtrusive validation, to dynamically remove the Required attribute from an element? The element is decorated with a Required annotation in the view model. I thought I could remove this by removing the html attribute, "data-val-required," with JQuery but client validation still treats the element as required. Is it impossible to manipulate the element's validation by manipulating the unobtrusive validation attributes? This is what I tried, but it