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

99
Visualizações
How to bind 2 input fields dynamically added in a table with Jquery

I am not very familiar with javascript/Jquery Syntax, I would like to bind 2 input text fields that were dynamically added to a table inside a loop. The main goal is to automatically fill the second text field with text from the first one. I was able to do it for 2 static text field by doing that.

$(document).bind('input', '#changeReviewer', function () {
    var stt = $('#changeReviewer').val();
    stt = stt.replace(/ /g,'.')
   $("#changeReviewerEmail").val(stt + "@@xxxxxx.com");
});

I have tried a few things but when I try to get the value of the first input, it always returns empty. Thanks.

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

0

Check this code

$(document).on('input', '#changeReviewer', function() {
  var stt = $('#changeReviewer').val();
  stt = stt.replace(/ /g, '.');

  $("#changeReviewerEmail").val(stt + "@@xxxxxx.com");
});


$('#addbtn').click(function() {
  $('div').empty().append(`<input id='changeReviewer'><input id='changeReviewerEmail'>`);

});
<script src="https://cdnjs.cloudflare.com/ajax/libs/jquery/3.3.1/jquery.min.js"></script>

<div>
  <button id='addbtn'>add inputs</button>
</div>

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