Empresas
Empregos
  • Sobre nós
  • Soluções
    • Publicação de vagas
      Publique sua vaga e receba candidatos qualificados em 48h.
    • Avaliações de candidatos
      Mais de 500 testes técnicos e psicológicos, mais anti-fraude.
    • Headhunting
      Busca executiva personalizada do início ao fim.
    • Folha de Pagamento + EOR
      Dispersão de folha e EOR em mais de 15 países da LATAM.
  • Preços
  • Empregos

0

102
Visualizações
Modal Input extract initials only

I have a modal input with 2 fields. One is the text input for the full name and the second is a disabled field to get the live result. The result is the Capitalized letter of each word in the input text field 1. I have no clue on how to go about doing this, any thoughts or ideas?

$(function() {
                var $src = $('#inputClientName'),
                  $dst = $('#disabledinputClientCode');
                $src.on('input', function() {
                  $dst.val($src.val());
                });
              });

//This is what I tested:
//match(/(\b\S)?/g).join("").toUpperCase()

This code lets me copy the input into the destination text block. I tried using the test code above and could not get the desired result. Please help.

about 4 years ago · Juan Pablo Isaza
2 Respostas
Responde à pergunta

0

I think easiest would be to use a Regex. Something like this should do the job:

const input = "This Is Some Test";
const output = input.match(/[A-Z]/g);

console.log(output);

about 4 years ago · Juan Pablo Isaza Relatório

0

You can use CSS to do that. There is a CSS prop: text-transform (docs here). When you add text-transform: capitalize; to the styling of the input it will capitalize each word. Now all you have to do is set the value of the first input to be equal to the value of the second input.

about 4 years ago · Juan Pablo Isaza Relatório
Responde à pergunta
Encontrar trabalhos remotos

Descubra a nova forma de encontrar um emprego!

melhores empregos
Principais categorias de trabalho
Empresas
Postar vaga Preços Comercial
Jurídico
Termos e Condições Política de privacidade
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Recomende algumas ofertas para mim
Preciso de ajuda