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:[\
Create you data-bind pointing at your shiny new code:
Shiny new knockout code:
price = ko.observable();
price.subscribe(function(newValue) {
price = newValue.replace(/[\D\.]/g, '');
});
This means that every time you update the price, it will apply the logic in the function (in this case stripping out anything that isn't a number or a period), and apply it directly to the price. You can also add other validation or cool features here, like adding a currency sybmol at the start, keeping it to 2 decimal places, etc...