/focus-invalid-field

angular directive to set focus on first visible invalid field on submitting a form

Primary LanguageHTMLMIT LicenseMIT

focus-invalid-field

angular directive to set focus on first visible invalid field on submitting a form

Demo

DEMO link

Installation

Install using bower -

 bower install --save focus-invalid-field

Inject the focus.invalid.field module into your module for using the directive -

 angular.module('myApp', ['focus.invalid.field'])

Usage

Add the focus-invalid-field attribute onto the form tag -

 <form name="myFormNg" novalidate ng-submit="submitTheForm()" focus-invalid-field>

Credits

Created module from ideas from -- Stack Overflow

iandotkelly , roryf and pcatre

License

MIT License