I really appreciate your helps!
Today I wrote a code with javascript to create a new table row when I press a “Add” button. It works very well in the Mozilla. But when I tried in the IE, it dosen’t work. When I pressed the button, no new row is created and also no error in the page. The codes are as follows:
<html>
<head>
<script language=”JavaScript”>
function addService()
{
var a = navigator.userAgent.indexOf(“MSIE”);
var style_display;
if ( a!=-1) {
style_display=’block’; }
else {
style_display=’table-row’; }
mycurrent_table = document.getElementById(“outbound_table”);
mycurrent_row=document.createElement(“div”);
mycurrent_col=document.createElement(“td”);
mycurrent_col.setAttribute(“align”,”center”);
mycurrent_col.style.display=style_display;
_m1 = ‘<input type=”text” value=”test1″>’;
mycurrent_col.innerHTML =
mycurrent_row.appendChild(mycurrent_col);
mycurrent_table.appendChild(mycurrent_row);
}
</script>
</head>
<body >
<form name=”Outbound Service”
method=”post”>
<table bgbolor=”White” width=”100%” id=”outbound_table”>
<tr>
<td bgcolor=”#0033CC” align=”center” colspan=”6″>
<font face=”Verdana,Arial” size=”2″ color=”#FFFFF”><b>Outbound
Services</b></font>
</td>
</tr>
<tr bgcolor=”#FFFFD6″ id=”service_header”>
<th></th>
</tr>
<tr bgcolor=”#CCCCCC” id=”serviceList”>
<td align=”center” id=”service_radio”>
<input type=”text” >
</td>
</tr>
</table>
<tr id=”service_button”>
<table width=”100%”>
<tr>
<td align=”right”>
<input type=”Button” value=”Add” class=”button1″
onclick=”addService()”>
</td>
<td align=”center”>
<input type=”Button” value=”Save” class=”button1″>
</td>
<td align=”left”>
<input type=”Button” value=”Delete” class=”button1″
onclick=”deleteService()”>
</td>
</tr>
</table>
</tr>
</form>
</body>
</html>
Thanks,
Rui ?