Business
Jobs
  • About Us
  • Solutions
    • Job Postings
      Post your job and receive qualified candidates in 48h.
    • Candidate Assessments
      500+ technical and psychological tests, plus anti-fraud.
    • Headhunting
      Tailor-made executive search from start to finish.
    • Payroll + EOR
      Payroll dispersal and EOR across 15+ LATAM countries.
  • Pricing
  • Jobs

0

98
Views
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 answers
Answer question

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 Report
Answer question
Find remote jobs

Discover the new way to find a job!

Top jobs
Top job categories
Business
Post vacancy Pricing Sales
Legal
Terms and conditions Privacy policy
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Show me some job opportunities
There's an error!