I have asp.net mvc3 project where I do a bulk edit on a table with knockout binding. I want to do validations like required and number validations while saving data. Is there any easier way to do knock out validations.
PS: I am not using forms.
I have asp.net mvc3 project where I do a bulk edit on a table
Share
Have a look at Knockout-Validation which cleanly setups and uses what’s described in the knockout documentation. Under: Live Example 1: Forcing input to be numeric
You can see it live in Fiddle
UPDATE: the fiddle has been updated to use the latest KO 2.0.3 and ko.validation 1.0.2 using the cloudfare CDN urls
To setup ko.validation:
To setup validation rules, use extenders. For instance: