angular-bootstrap-show-errors
angular-bootstrap-show-errors copied to clipboard
README.md is outdated
-
The current README file does not mention using a
form-control
class on the target field, but when not used, script throws error:show-errors element has no child input elements with a 'name' attribute and a 'form-control' class <div class="form-group" show-errors="">
. -
Using
.form-control
class on a checkbox, ie. requiring a user to check that they agree with your terms and conditions, it's invalid bootstrap code for a checkbox. So the result is the checkbox has style applied to it that makes it look really messed up (appears gigantic and with a shadow border). Therefore,angular-bootstrap-show-errors
should not rely on aform-control
class being present.
Checkbox without .form-control
class:
+1. Facing the same issue.
+1 here, anyone found a workaround for the checkboxes problem?
Current workaround: Manually add the has-error
class:
<form name="myFormName">
<div class="form-group">
<div class="checkbox" ng-class="{'has-error': myFormName.myCheckboxName.$invalid}">
<label>
<input type="checkbox" name="myCheckboxName"/>>
<span>My checkbox label</span>
</label>
</div>
</div>
</form>
Up:
link is dead:
See the Bootstrap Form Validation Done Right in AngularJS blog post to read about the benefits of using this directive.