Closed mauricioferrazs closed 7 years ago
If I understand you correctly, there is such a possibility, but not out of the box. You could make a use of eavalid
event + some additional coding to achieve that.
Instead of disabling non-required fields, some users prefer hiding, some other annotating with asterisk, etc. In the MVC sample I've provided examplary solution to such use cases. Take a look at Home.cshtml view - annotateRequiredFields()
function in particular.
In addition, to grab more outlook, go through similar questions which already have been asked before, i.e. https://github.com/jwaliszko/ExpressiveAnnotations/issues/121, and updated https://github.com/jwaliszko/ExpressiveAnnotations/issues/139.
Thanks jwaliszko. I will take a look that.
Related section added to the documentation: https://github.com/jwaliszko/ExpressiveAnnotations#can-i-decorate-conditionally-required-fields-with-asterisks
Is there any way to hide or disable a field based on another equal to the requiredif?
Thanks