Last active
February 27, 2016 17:13
-
-
Save chadedrupt/5746011 to your computer and use it in GitHub Desktop.
Use Bootstrap's error stying with knockout validation
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
ko.validation.configure({ | |
insertMessages: true, | |
decorateElement: true, | |
errorElementClass: 'error', | |
errorMessageClass: 'help-inline' | |
}); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<div class="control-group" data-bind="validationElement: Description"> | |
<label class="control-label" for="inputDescription">Description</label> | |
<div class="controls"> | |
<input id="inputDescription" type="text" data-bind="value: Description" maxlength="100" required /> | |
</div> | |
</div> |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Awesome - thanks!