I am validating an input field for unique parameters for this i am using this code .
self.loanterm = ko.observable().extend({ required: true,unique: {
collection: self.termValues,
externalValue: ""
} });
but when i am adding duplicate value it doesn't showing me any message. termValues is an observable array whose values i am adding like this .
self.PopulateLoans = ko.computed(function(){
ko.utils.arrayForEach(dummyData, function(item){
self.Terms.push(new Term(item));
self.termValues.push(item.loanterm);
});
});
i am using knockout validation plugin for this.
Here is js fiddle link