https://github.com/allexcd/input-only-numbers
AngularJS directive that replaces any other character except digits.
https://github.com/allexcd/input-only-numbers
Last synced: about 1 year ago
JSON representation
AngularJS directive that replaces any other character except digits.
- Host: GitHub
- URL: https://github.com/allexcd/input-only-numbers
- Owner: allexcd
- License: mit
- Created: 2014-04-22T19:16:33.000Z (about 12 years ago)
- Default Branch: master
- Last Pushed: 2014-04-23T07:31:18.000Z (about 12 years ago)
- Last Synced: 2025-05-18T04:16:21.992Z (about 1 year ago)
- Language: JavaScript
- Size: 199 KB
- Stars: 1
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE.md
Awesome Lists containing this project
README
input-only-numbers
========================
AngularJS directive that replaces any other character except digits. Can be used on type type text, number, tel input fields. Number and tel input fields will open the corresponding keyboard on mobile devices. But on some devices, these keyboards still contains some characters like dots or commas, so this directive forbids the user inputting anything else than digits.
Dependencies
============
To use this directive in your projects, you must include its dependencies. Asumming you already have angular and jquery libraries included in your project, you're going to need the main directive file: InputOnlyNumbers.js
Usage
=====
Once you've checked that everything is in place, you can use this directive like so:
```html
```
or
```html
```
Demo
====
http://plnkr.co/edit/yEg30CGUbnADRougatM9?p=preview
http://embed.plnkr.co/yEg30CGUbnADRougatM9/preview