Rameez Javed

Rameez Javed

  • 1.7k
  • 360
  • 32.9k

Clear the suggest tag value while cloning the row javascript

Dec 11 2019 1:54 AM
Im having an issue regarding my suggest textbox, when i add a new row, all the fields are fine except the suggest tag textbox. Code snippet is as below... 
  1. var table = document.getElementById(tableID);  
  2.   
  3.   
  4.             var rowCount = table.rows.length;  
  5.             var row = table.insertRow(rowCount);  
  6.             var colCount = table.rows[1].cells.length;  
  7.   
  8.             for (var i = 0; i < colCount; i++) {  
  9.                 var newcell = row.insertCell(i);  
  10.   
  11.                 newcell.innerHTML = table.rows[1].cells[i].innerHTML;  
  12.   
  13.                 switch (newcell.childNodes[0].type) {  
  14.                     case "text":  
  15.                         newcell.childNodes[0].value = "";  
  16.   
  17.                         break;  
  18.                     case "checkbox":  
  19.                         newcell.childNodes[0].checked = false;  
  20.                         break;  
  21.                     case "select-one":  
  22.                         newcell.childNodes[0].selectedIndex = 0;  
  23.                         break;  
  24.                 }  
  25.   
  26.             }  

Answers (1)