Reading only one row from table in model binder
- by user281180
I am filling a table dynamically. I can see the table filled with 3 rows, but in my model binder I can read only one value. How can I solve this problem? My code is as follows:
function AddTableRow(jQtable, value, text){
var count = 0;
jQtable.each(function() {
var $table = $(this);
var tds = '<tr>';
tds += '<td>' + '<input type="text" value = ' + text + ' disabled ="disabled" style="width:auto"/>' + '<input type="hidden" name="projectList[' + count + '].ID" value = ' + value + ' /></td>' + '<td><input type="button" value="Remove"/></td>';
tds += '</tr>';
if ($('tbody', this).length > 0) {
$('tbody', this).append(tds);
}
else {
$(this).append(tds);
}
count++;});
}
function ReadSelectedProject() {
$("#Selected option").each(function() {
AddTableRow($('#projectTable'), $(this).val(), $(this).text());
});
}