val-on-timeout

AngularJS directive for validating form fields only after user has stopped typing.
Homepage:
1 person uses it
Author: 3641ca23c64b89e6b15eb25c54568146?d=https%3a%2f%2fidenticons.github.com%2fffa21eede4ae8ecea1b787ded25bc9d5 calendee

val-on-timeout

val-on-timeout improves the user experience for forms. When the user has stopped activity in a field, validation errors will be displayed.

Features

  • Configurable timeout after pause in typing
  • Configurable timeout on focus
  • Configurable timeout on blur

Usage

Simply include as a dependency in your module.

Examples

Detect When User Stops Typing

NOTE : The default timeout for typing is 1250ms.

Detect When User Stops Typing With Custom Timeout Limit

Detect When Field Has Had Focus For Too Long

If a user focuses on a field but fails to begin typing, the timeout can be detected. The default focus timeout is 5000ms. It can be configured by providing any value with the attribute.

Detect When Field Blurred

If a field loses focus, you can apply the timeout to display errors. The default focus timeout is 500ms. It can be configured by providing any value with the attribute.

Demo

To run a demo, start a local Python server from the repository's root directory :

Then, go to : http://localhost:3001/example/

Testing

From the project root directory, run karma start.

Authors

Justin Noel

Acknowledgements

Thanks to Ari Lerner (@auser) for the inspiration for this directive. His ngFocus directive lead the way.

I whined about my complaints with Angular JS validation to Sharon DiOrio (@sharondio) while at #ng-conf. She didn't take pity and suggested I do something about it. Thanks for the push.

LICENSE

val-on-timeout is licensed under the MIT Open Source license. For more information, see the LICENSE file in this repository.

comments powered by Disqus
This page was last updated almost 4 years ago.