Reputation: 662
I am currently using RobinHerbots input-mask: https://github.com/RobinHerbots/Inputmask
You can refer to the currency demo according to this page: http://robinherbots.github.io/Inputmask/ and click the demo tab, then currency
I am trying to implement a similar currency mask with decimal input disable. So user will not able to press "." and move to decimal
for example:
the screenshot above is a perfect example. However, user can still use arrow keys or "." to navigate the cursor. Is there anyway to disable it?
Any ideas?
Thanks in advance.
Upvotes: 1
Views: 4099
Reputation: 662
Use this 'digits': '0' configuration will fix the problem:
data-inputmask="'alias': 'currency', 'placeholder': '', 'digits': '0', 'allowMinus': 'false', 'showMaskOnFocus': 'false', 'showMaskOnHover': 'false'"
Upvotes: 3