Skip to content

Instantly share code, notes, and snippets.

@scriptdev
Last active January 7, 2023 09:19
Show Gist options
  • Save scriptdev/4f8c338fda33c51f2c541c19d2977293 to your computer and use it in GitHub Desktop.
Save scriptdev/4f8c338fda33c51f2c541c19d2977293 to your computer and use it in GitHub Desktop.
MÁSCARA DINÂMICA AO DIGITAR DO TELEFONE e CELULAR NO TEntry
<?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