🔔 Alert..!! Get 2 Month Free Cloud Hosting With $200 Bonus From Digital Ocean ACTIVATE DEAL

Mask As Number is a lightweight and useful jQuery plugin which restricts the input fields to a specific number of numeric values and prevents invalid keystrokes.

input-mask number-format

Documentation

jquery-mask-as-number

npm npm License: MIT Known Vulnerabilities

Simple mask jquery extension that ensures valid integer numbers in text inputs

Demo: https://jsfiddle.net/andretissot/9prtpcd5/

HTML5 number field only highlites invalid entry, but doesn't enforce the valid:

  • On Chrome 55:
    Inserting invalid numbers in chrome number fields

  • On Firefox 50:
    Inserting invalid numbers in firefox number fields

This jquery extension forces the input to only allow integer values, and minus if first character.

The input value is not limited by the Browser's maximum integer.


You May Also Like