0
Good morning, I’m trying to add a mask to Cpf from a select, but I’m not getting it.
HTML
<select class="form-control" id="select" style="width:100px;" title="Escolha..." name="select">
<option>Escolha...</option>
<option value="user_nome">Nome</option>
<option value="user_cpf">CPF</option>
<option value="user_email">Email</option>
<option value="user_loja">Loja</option>
</select>
<input type="text" id="busca" class="form-control" placeholder="Digite sua busca" name="busca" style="width:250px;">
jQuery:
var $select = $('#select option:selected').val();
if( $select == "CPF") {
var $busca = $('#busca');
$busca.mask('999.999.999-99');
}
Thanks man, that way it worked right.
– Mauricio Mikulski