-2
Hello! I need help!! I would like to create an acronym for the client with 3 characters, when I type in the first input will generate in the second input, examples: "ABOBORA" generates "ABO", "ABOBORA DOURADA" generates "ABD", "ToSILLY DOURADA BONITA" generates "ADB".
Have:
<input type="text" name="nomeCliente" value="<?php echo $this->input->post('nomeCliente'); ?>" class="form-control text-uppercase nomeSigla" id="nomeCliente" />
<input type="text" minlength="3" maxlength="3" name="siglaCliente" value="<?php echo $this->input->post('siglaCliente'); ?>" class="form-control text-uppercase siglaSigla" id="siglaCliente" />
I’d like to take the data from class for use in other forms (Contacts, suppliers, etc).
I tried to start the tests using this code, but only copies it to the next input and does not limit the second to 3 characters.
$(".nomeSigla").on('input',function(event) {
var data=$(this).val();
$(".siglaSigla").val(data);
});
Thank you very much!
Robson! Thank you very much, it worked perfectly! I will remove the spaces to ensure
– Luciano Marangoni
@Lucianomarangoni Great! Please accept my implementation then.
– pharoeste