Skip to content

Instantly share code, notes, and snippets.

Show Gist options
  • Save gregoryagu/6cf35e2d8a0eb36431f7 to your computer and use it in GitHub Desktop.
Save gregoryagu/6cf35e2d8a0eb36431f7 to your computer and use it in GitHub Desktop.
Updated for Bootstrap 3.3.5 and KO 3.3.0
ko.validation.init({
insertMessages: true,
decorateInputElement: true,
errorElementClass: 'has-error',
errorMessageClass: 'help-block'
});
this.first = ko.observable("Greg").extend({ required: true });
<div class="form-group" data-bind="validationElement: first">
<label for="inputFirst">First Name</label>
<input class="form-control" id="inputFirst" type="text" data-bind="value: first" maxlength="100" />
</div>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment