I been used to do validation using knockout validation plugin and all of a sudden i am facing a issue i am unable to get rid of .
Html onLoad :
<input class="form-control" type="text" data-bind="value:$data.Name"/>
<span class="required" style="display: none;"></span>
<span class="required" style="display: none;"></span>
ViewModel:
function details() {
var self =this;
self.Name = ko.observable("");
self.Validation = ko.validatedObservable([
self.Name.extend({ number: true })
]);
}
When i removed self.Name.extend
i get no
span tags onLoad but if i keep it then i get two span tags and because of that i get same error messages displaying twice under control like this field is required
& this field is required
.
I also debugged and checked the function is excecuting only once .
I refered this but i can't fix my issue .
I hope someone can show light on this issue .