Problem in reading data in table shown

Posted by user281180 on Stack Overflow See other posts from Stack Overflow or by user281180
Published on 2010-03-29T09:41:53Z Indexed on 2010/03/29 9:53 UTC
Read the original article Hit count: 169

Filed under:

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);
            });
        }

© Stack Overflow or respective owner

Related posts about jQuery