1
Hello, I have the following code snippet
onkeypress="mascaraMutuario(this,cnpj)
Where it is one that creates a mask for CNPJ or CPF. However, I have
<?php
$bs = array('0' => '', '1' => 'Pessoa Física', '2' => 'Pessoa Jurídica');
echo form_dropdown('tipo', $bs, set_value('tipo', '0'), 'class="form-control select2" id="tipo" required="required" style="width:100%;"');
?>
Where I would like that depending on the type of person selected it called my specific function, passing by parameter the CNPJ or CPF.
Your question is not very clear, but from what I understand, you want to modify an area of the page according to the selection of individual or legal, is this?
– Wictor Chaves
that’s exactly what
– spiderman123
You should do this using javascript.
– Wictor Chaves
I would have some example of how I can do?
– spiderman123
But what do you want to do on the screen?
– Wictor Chaves
who put the mask, depending on the type of person selected, on an inpput
– spiderman123
I’ll do it here as your answer
– Wictor Chaves