Disable required validation by JavaScript
问题 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 (by Attribute in Model). Unfortunatly when the checkbox is not checked, the required validation is performed on the properties hidden. How can I disable the required validation for this properties? I tried setting the data-val property of the input element to false but this does not work. Some an idea? Thanks in advance