Socket
Socket
Sign inDemoInstall

jquerysimplemask

Package Overview
Dependencies
0
Maintainers
1
Versions
11
Alerts
File Explorer

Advanced tools

Install Socket

Detect and block malicious and high-risk dependencies

Install

    jquerysimplemask

Simple and fast number input masks.


Version published
Weekly downloads
7
increased by600%
Maintainers
1
Install size
9.16 kB
Created
Weekly downloads
 

Readme

Source

jQuerySimpleMask

Simple and fast number input masks

npm version License: MIT

Demo

https://devutils.github.io/jQuerySimpleMask/

Usage

<form>
	<p>
		<label for="frCep">CEP</label><br/>
		<input type="text" name="frCep" id="frCep"/>
	</p>
	<p>
		<label for="frDtel">(DDD) Telefone</label><br/>
		<input type="text" name="frDtel" id="frDtel"/>
	</p>
	<p>
		<label for="frTel">Telefone</label><br/>
		<input type="text" name="frTel" id="frTel"/>
	</p>
	<p>
		<label for="frData">Data</label><br/>
		<input type="text" name="frData" id="frData"/>
	</p>
	<p>
		<label for="frCpf">CPF</label><br/>
		<input type="text" name="frCpf" id="frCpf"/>
	</p>
	<p>
		<label for="frCnpj">CNPJ</label><br/>
		<input type="text" name="frCnpj" id="frCnpj"/>
	</p>
	<p>
		<label for="frCallback">With Callback</label><br/>
		<input type="text" name="frCallback" id="frCallback"/>
	</p>
</form>

Helper mode

$(document).ready
(
	function()
	{
		$('#frCep' ).simpleMask( { 'mask': 'cep'     , 'nextInput': false } );
		$('#frDtel').simpleMask( { 'mask': 'ddd-tel9', 'nextInput': false } );
		$('#frTel' ).simpleMask( { 'mask': 'tel9'    , 'nextInput': false } );
		$('#frData').simpleMask( { 'mask': 'data'    , 'nextInput': false } );
		$('#frCpf' ).simpleMask( { 'mask': 'cpf'     , 'nextInput': false } );
		$('#frCnpj').simpleMask( { 'mask': 'cnpj'    , 'nextInput': false } );
	}
);

Custom mode

$(document).ready
(
	function()
	{
		$('#frCep' ).simpleMask( { 'mask': '#####-###'                          , 'nextInput': $('#frDtel') } );
		$('#frDtel').simpleMask( { 'mask': ['(##) ####-####', '(##) #####-####'], 'nextInput': $('#frTel' ) } );
		$('#frTel' ).simpleMask( { 'mask': ['####-####', '#####-####']          , 'nextInput': $('#frData') } );
		$('#frData').simpleMask( { 'mask': '##/##/####'                         , 'nextInput': $('#frCpf' ) } );
		$('#frCpf' ).simpleMask( { 'mask': '###.###.###-##'                     , 'nextInput': $('#frCnpj') } );
		$('#frCnpj').simpleMask( { 'mask': '##.###.###/####-##' } );
		$('#frCallback').simpleMask
		(
			{
				'mask'       : '#####',
				'nextInput'  : true,
				'onComplete' : function(element)
				{
					console.log('onComplete', element);
				}
			}
		);
	}
);

Keywords

FAQs

Last updated on 07 Oct 2022

Did you know?

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc