knockout.js - Between two numbers validation in knockout? -


i trying write validation performs similar between .

i having textbox , want show error message if failed enter other given range .

viewmodel :

var vm = function viewmodel() { var self = this; self.mainamount=ko.observable(); self.amount1=ko.observable(2); // dynamic self.amount2=ko.observable(100)  self.validation = ko.validatedobservable({ self.mainamount.extend({required:true,number:true,min:self.amount1,max:self.amount2})   }); } 

i tought min , max acts between i'm wrong , unable work out .

i gave tought try

validator:{validation:function(param1,param2,param3){ //logic here }, message:'enter between these ..', params: // here unable pass multiple paramters  } 

reference : click here . in article @ last there custom way things confused in return statement inside computed .

any appreciated .


Comments

Popular posts from this blog

c++ - QTextObjectInterface with Qml TextEdit (QQuickTextEdit) -

javascript - angular ng-required radio button not toggling required off in firefox 33, OK in chrome -

xcode - Swift Playground - Files are not readable -