-
-
Save carlosleonam/d0c543cb48f0fa2089147f5b9b8c22fd to your computer and use it in GitHub Desktop.
MÁSCARA DINÂMICA AO DIGITAR DO TELEFONE e CELULAR NO TEntry
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
## ADICIONAR ANTES DO parent::add($container);########################## | |
TScript::create( | |
"$(document).on('keydown', 'input[name=\'celular\']', function (e) { | |
var digit = e.key.replace(/\D/g, ''); | |
var value = $(this).val().replace(/\D/g, ''); | |
var size = value.concat(digit).length; | |
$(this).mask((size <= 10) ? '(00) 0000-0000' : '(00) 00000-0000'); | |
});" | |
); | |
parent::add($container); | |
## AGRADIMENTOS: EDUARDO OLIVEIRA ###################################### |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment