I'm using knockout validation to validate my view models and put a confirmation or error message next to fields using the custom template. The problem is the confirmation message is being added to fields that are not marked as required. In the template it checks for isModified and isValid but is there a way to check that the field is required so I can only show the confirmation on required fields?
<script type="text/html" id="myCustomTemplate">
<span data-bind="if: field.isModified() && !field.isValid(),
attr: { title: field.error }"><i class="icon-exclamation-sign"></i></span>
<span data-bind="if: field.isModified() && field.isValid()"><i class="icon-ok green"></i></span>
</script>