![]() | |
![]() |
| | Thread Tools | Search this Thread | Display Modes |
#1
| |||
| |||
|
#2
| |||
| |||
|
|
I use JavaScript to insert Row with textbox into table on client script. When i entered value into dynamic textbox, i could get textbox object using getElementById. Code is below how row was added. function addRowToTable() { var tbl = document.getElementById('tblSample'); var lastRow = tbl.rows.length; // if there's no header row in the table, then iteration = lastRow + 1 var iteration = lastRow; var row = tbl.insertRow(lastRow); // left cell var cellLeft = row.insertCell(0); var textNode = document.createTextNode(iteration); cellLeft.appendChild(textNode); // right cell var cellRight = row.insertCell(1); var el = document.createElement('input'); el.setAttribute('type', 'text'); el.setAttribute('name', 'txtRow' + iteration); el.setAttribute('size', '40'); cellRight.appendChild(el); } Any help will be appr. |
![]() |
| Thread Tools | Search this Thread |
| Display Modes | |
| |