jonsamwell / angular-auto-validate

An automatic validation module for AngularJS which gets rid of excess html in favour of dynamic element modification to notify the user of validation errors
MIT License
346 stars 76 forks source link

Correct icons for select, check and radio + Add support for bootstrap checkbox and radio buttons + add support for specific help-block container #153

Open elkami12 opened 8 years ago

elkami12 commented 8 years ago

First thanks for your work !

This pull request is for:

Feedback icons only work with textual elements.

  • add a new feature for inserting help-block in specific place. Sometime it can be useful to be able to set precisely where the help-block should be added if element becomes invalid. Now you can just put a container with help-block-cont class inside the form-group to force the help-block to be added in it. It is particularly useful with horizontal forms with grid structure. Example:
<div class="form-group">
    <label for="xxx" class="col-sm-5 control-label">Label_XXX</label>
    <div class="col-xs-6 col-sm-2">
        <input id="xxx" name="xxx" ng-model="vm.xxx" type="number" class="form-control" required>
    </div>
    <div class="col-xs-6 col-sm-5">
        <p class="form-control-static">more text</p>
    </div>
    <div class="clearfix"></div>
    <div class="col-xs-12 col-sm-7 col-sm-offset-5 help-block-cont"></div>
</div>

Cordially and sorry for my english...