i read many tutorials but i dont know how to do this, this is the input
input(type=\"text\",name=\"price\",id=\"price\"data-bind=\"text: price,valueUpdate:[\
Best for today's scenerio https://github.com/Knockout-Contrib/Knockout-Validation
run the snippet below. entering a non digit or something more than 255 will cause the message to display.
function model() {
var self = this;
this.myObj = ko.observable().extend({ digit: true }).extend({ max: 255});
}
var mymodel = new model();
$(document).ready(function() {
ko.validation.init();
ko.applyBindings(mymodel);
});
enter a digit less than or equal to 255
Enter something other than a digit or over 255 will cause an error.
courtesy: Bryan Dellinger: https://stackoverflow.com/a/42940109/3868653