-
-
Save fayqLs/4f8c338fda33c51f2c541c19d2977293 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