mask numeric values - Free Download Mask Numeric Values In Input Fields - jQuery NumberMask

Free Download Mask Numeric Values In Input Fields – jQuery NumberMask

Posted on

This time I will share jQuery Plugin and tutorial about Mask Numeric Values In Input Fields – jQuery NumberMask, hope it will help you in programming stack.

File Size: 7.65 KB
Views Total: 1163
Last Update:
Publish Date:
Official Website: Go to website
License: MIT
   

A really simple number input masking plugin for jQuery that can be used to mask numeric values such as photo numbers, dates & times, credit card numbers/CVC, IP addresses, etc.

Licensed under the Apache License, Version 2.0.

How to use it:

1. Download the plugin and then insert the JavaScript file numbermask.js after loading the latest jQuery library (slim build is recommended).

1 <script src="/path/to/cdn/jquery.slim.min.js"></script>
2 <script src="/path/to/numbermask.js"></script>

2. Initialize the plugin on your form fields and specify the customize the number of spaces in the mask parameter:

01 <h2>Phone Number</h2>
02 <input type="text" id="phone" name="phone" />
03  
04 <h2>Birth Day</h2>
05 <input type="text" id="day"name="day" />
06  
07 <h2>Credit Card</h2>
08 <input type="text" id="card" name="card" />
09  
10 <h2>CVS</h2>
11 <input type="text" id="cvc" name="cvc" />
01 $(function () {
02  
03   $('#phone').numbermask({
04       mask: "+# (###) ###-##-##"
05   });
06    
07   $('#day').numbermask({
08       mask: "##/##/####"
09   });
10  
11   $('#card').numbermask({
12       mask: "####-####-####-####"
13   });
14  
15   $('#cvc').numbermask({
16       mask: "###"
17   });
18  
19 });

This awesome jQuery plugin is developed by keygenqt. For more Advanced Usages, please check the demo page or visit the official website.