paulyoder / angular-bootstrap-show-errors

An Angular directive for Bootstrap to intelligently show form validation errors
MIT License
331 stars 77 forks source link

Option for trigger event, defaults to blur #14

Closed Templarian closed 10 years ago

Templarian commented 10 years ago

Hello Paul,

Really useful directive. I've been using it for a bit, but I figured I should share this tiny modification to make blur configurable. For some fields where I have very specific patterns it is ideal not to wait for a blur event.

<form name="userForm">
  <div class="form-group" show-errors="{ trigger: 'keypress' }">
    <input type="text" name="firstName" ng-model="firstName" ng-pattern="/^foo$/" ng-required />
  </div>
</form>

Thanks for the great directive!

(I edited the coffee script in github really quick, so hopefully there are no typos)

paulyoder commented 10 years ago

Thanks @Templarian! This has now been merged into version 2.0.0

Templarian commented 10 years ago

Awesome! Glad to help out.