I want to send the inputted value from the textboxes to another textbox. Here's my code
$('.col_bot').on('click', function(e) {
// alert('hoi');
var a = parseInt(document.getElementById("nochapter").value);
var ch = document.getElementById("ch");
var HTML = '<table width=50% class="eg_form">';
for (i = 0; i < a; i++) {
HTML += '<tr><td align="center">';
HTML += '<input type="text" id="aaa" name="aaa[]"></td>';
HTML += '<td align="center">';
HTML += '<input type="text" id="bbb" name="bbb[]"></td></td></tr>';
document.getElementById("ch").innerHTML = HTML;
}
var arrr = document.getElementsByName("bbb[]");
var arr = $(arr);
var ar = arr.val();
$("#bbb").keyup(function() {
var edValue = document.getElementsByName("bbb[]");
var s = $(edValue);
var edValue2 = document.getElementsByName("aaa[]");
var s2 = $(edValue2);
for (var i = 0, iLen = arrr.length; i < iLen; i++) {
alert(arrr[i].value);
document.getElementById("eg_hidden").value = '{' + s2.val() + ':' + s.val() + '}';
}
});
});
<script src="https://ajax.googleapis.com/ajax/libs/jquery/2.1.1/jquery.min.js"></script>
<div class="abab" id="abab">
<input type="text" id="nochapter" />
<input type="button" value="Number of rows" class="col_bot" />
<div id="ch" class="abab"></div>
<br>
<input type="text" id="eg_hidden" name="eg_hidden" /> Summary
</div>
First you will input number of rows you want:
Second you will input the details and while your inputting, the summary textbox will updated too like this:
The issue is the summary will only get the first row.

