README
Knockout Validation
A KnockoutJS Plugin for model and property validation
Contributors:
- Eric Barnard
- Steve Greatrex
- Cristian Trifan
- Andy Booth
- Michal Poreba
- and many others!
License: MIT
Install
Bower
bower install knockout-validation --save
NuGet
PM> Install-Package Knockout.Validation
NPM
npm install knockout.validation --save
CDN
cdnjs
- https://cdnjs.cloudflare.com/ajax/libs/knockout-validation/2.0.4/knockout.validation.js
- https://cdnjs.cloudflare.com/ajax/libs/knockout-validation/2.0.4/knockout.validation.min.js
jsdelivr
- https://cdn.jsdelivr.net/npm/knockout.validation@2.0.4/dist/knockout.validation.js
- https://cdn.jsdelivr.net/npm/knockout.validation@2.0.4/dist/knockout.validation.min.js
Getting Started
//start using it!
var myValue = ko.observable().extend({ required: true });
//oooh complexity
var myComplexValue = ko.observable().extend({
required: true,
minLength: 3,
pattern: {
message: 'Hey this doesnt match my pattern',
params: '^[A-Z0-9].