angular-bootstrap-show-errors icon indicating copy to clipboard operation
angular-bootstrap-show-errors copied to clipboard

README.md is outdated

Open mpiasta-ca opened this issue 9 years ago • 4 comments

  1. 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="">.

  2. 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 a form-control class being present.

Checkbox looks gigantic as a result of .form-group class

Checkbox without .form-control class:

Checkbox without the form-control class

mpiasta-ca avatar Jun 01 '15 23:06 mpiasta-ca

+1. Facing the same issue.

sfdeveloperhub avatar Jan 11 '16 03:01 sfdeveloperhub

+1 here, anyone found a workaround for the checkboxes problem?

sargue avatar Mar 07 '16 09:03 sargue

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>

brunolemos avatar Sep 08 '16 02:09 brunolemos

Up:

link is dead:

See the Bootstrap Form Validation Done Right in AngularJS blog post to read about the benefits of using this directive.

WuglyakBolgoink avatar Oct 06 '17 07:10 WuglyakBolgoink