Mask & Format User Input In Text Fields - jQuery Samask

File Size: Unknown
Views Total: 6353
Last Update:
Publish Date:
Official Website: Go to website
License: MIT
Mask & Format User Input In Text Fields - jQuery Samask

Samask is a lightweight and easy-to-use jQuery input mask plugin for arbitrary input fields within the document.

It can be used to mask/validate/format/restrict user input in text fields to a specific pattern such as telephone number, date, time, duration, currency, IP address, and much more.

How to use it:

1. Include the jquery.samask-masker.js script after jQuery library.

<script src="" 
<script src="jquery.samask-masker.js"></script>

2. Apply the samask plugin to the input field and set the format that entered data must conform to.

<input class="demo" type="type">
$('.demo').samask("00/00/0000 00:00:00");

3. You can also specify the format via data attribute as this:

<input class="demo" type="type" data-samask="(000)000-0000">

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