I'm using the Inputmask plugin, the following JS
$("input[id*='cpfcnpj']").inputmask({
mask: ['999.999.999-99', '99.999.999/9999-99'],
keepStatic: true
});
My input
is catching the cpf mask , but gets caught in it. When it reaches the 11 digits, it does not enable the cnpj mask.