Problem in reading data in table shown
- by user281180
I can see values shown in my table but I can`t read all of them except the first one using the following code;
function ReadNames () {
$('#Table tr td label').each(function () {
NameID.push(this.id);
});
}
How can I read all the values?The table is poplulated using a click on a dialog box
function addTableRow(jQtable, value, text){
jQtable.each(function() {
var $table = $(this);
var tds = '<tr>';
tds += '<td>' + '<label for="Name" id = ' + value + '>' + text + '</label></td>' + '<td><input type="button" value="Remove"/></td>';
tds += '</tr>';
if ($('tbody', this).length > 0) {
$('tbody', this).append(tds);
}
else {
$(this).append(tds);
}
});
}
function read() {
$("#SelectBox option").each(function() {
var value = $(this).val();
var text = $(this).text();
addTableRow($('#Table'),value,text);
});
}