Knockout validation prints the error messages in black color.
But I want it in my style. And in my application, I want all validation messages
should be in same style. For this I am trying to configure knockout-validation using
the following template and command.
When I bind my viewmodel, I am getting the error message that I put below. What is my mistake? What/ what step am I missing?
Any help highly appreciated.
Thanks in advance.
<script type="text/html" id="errMsg">
<span class="alert-danger"
data-bind="if: field.isModified() && !field.isValid(),
text: field.error,
attr: { title: field.error }">*</span>
</script>
<script type="text/javascript">
ko.validation.init({ messageTemplate: 'errMsg' });
</script>
I get the following message.
Message: Multiple bindings (if and text) are trying to control descendant bindings of the same element. You cannot use these bindings together on the same element.