I have a jsp page in which rows are created dynamically to a table using java script. It is working fine in all the browsers except IE. In IE it is showing the error Unknown run time error..
I have attached the java script function
function addrow(tableID) {
try{
var table = document.getElementById(tableID);
var rowCount = table.rows.length;
var row = table.insertRow(rowCount-1);
var mystring1='<td class="formlabel"><h4>Type </h4></td><td class="formfield"><input type="text" name="type7" id="type8" size="30"/></td><td class="formgap"></td><td class="formlabel"><h4>Description </h4></td><td class="formfield"><textarea name="textarea2" id="textarea2" cols="28" rows="2"></textarea></td>';
row.innerHTML =mystring1;
}catch(e) {
alert(e);
}
}
HTML part
<table id="table1" width="792" border="0">
<tr class="rowdiv">
<td class="formlabel"><h4>Type </h4></td>
<td class="formfield"><input type="text" name="type7" id="type8" size="30"/></td>
<td class="formgap"></td>
<td class="formlabel"><h4>Description </h4></td>
<td class="formfield"><textarea name="textarea2" id="textarea2" cols="28" rows="2"></textarea></td>
</tr>
<tr class="rowdiv">
<td width="170" class="formlabel"> </td>
<td class="formfield"> </td>
<td class="formgap"></td>
<td class="formlabel"> </td>
<td class="formfield"><h6 onclick="addrow('table1')">Add policy</h6></td>
</tr>
</table>
I could not post my question in stack overflow, Can anyone please help me to post it in stack overflow?????
