jQuery Plugin To Mask Numbers In Text Field - Secure Number Mask

File Size: 3.26 KB
Views Total: 4086
Last Update:
Publish Date:
Official Website: Go to website
License: MIT
   
jQuery Plugin To Mask Numbers In Text Field - Secure Number Mask

Secure Number Mask is a jQuery plugin used to mask text input field to prevent displaying the typed numbers. Similar to the password input that can be used for SSN input, credit card input and other security fields.

How to use it:

1. Include the jQuery javascript library and the jQuery secure number mask plugin in the document.

<script type="text/javascript" src="http://ajax.googleapis.com/ajax/libs/jquery/1.11.1/jquery.js"></script>
<script type="text/javascript" src="js/securenumbermask.js"></script>

2. Create a text input field that only accepts numbers.

<input class="form-control" type="text" id="inputtext" value="123"/>

3. Call the plugin on the text input field you just create and set the mask symbol & maxLength options.

<script>
$(document).ready(function(){
$('#inputtext').securenumbermask({
mask:'*',
maxlength:15
});
}); 
</script>

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