Below is my code. It not running on IE..You may copy and try this code..
Expand|Select|Wrap|Line Numbers
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1" >
<title>Untitled Document</title></head>
<script language="JavaScript" type="text/javascript">
var i=1;
function addRow()
{
var tbl = document.getElementById('table1');
var lastRow = tbl.rows.length;
var i = lastRow - 1;
var row = tbl.insertRow(lastRow);
var firstCell = row.insertCell(0);
var select = document.createElement('select');
select.name = 'name_' + i;
select.id = 'name_' + i ;
select.class = 'post';
select.innerHTML = document.getElementById('name_0').innerHTML;
firstCell.appendChild(select);
var secondCell = row.insertCell(1);
var el2 = document.createElement('input');
el2.type = 'text';
el2.name = 'address_' + i;
el2.id = 'address_' + i;
el2.size = 20;
el2.maxlength = 20;
secondCell.appendChild(el2);
var thirdCell = row.insertCell(2);
var el3 = document.createElement('input');
el3.type = 'text';
el3.name = 'contactNum_' + i;
el3.id = 'contactNum_' + i;
el3.size = 20;
el3.maxlength = 20;
thirdCell.appendChild(el3);
// alert(i);
i++;
frm.h.value=i;
// alert(i);
}
</script>
<body>
<?php
mysql_connect("localhost", "root", '')or die(mysql_error());
mysql_select_db("test") or die(mysql_error());
$num = $_POST['h'];
for($i=0;$i<$num;$i++)
{
$name = $_POST["name_$i"];
$address = $_POST["address_$i"];
$contactNum = $_POST["contactNum_$i"];
mysql_query("INSERT INTO `company`(`name`, `add`, `contact`) Values('$name', '$address', '$contactNum')") or die(mysql_error());
}
?>
<form method="post" name="frm" id="frm">
<table width="40%" border="2" cellpadding="0" cellspacing="0" id="table1">
<tr>
<td><strong>Name</strong></td>
<td><strong>Address</strong> </td>
<td><strong>Contact Num</strong> </td>
</tr>
<tr>
<td><select class="post" name="name_0" id="name_0" >
<option >Supervisor Negeri</option>
<option >Pegawai Daftar</option>
<option >Pegawai Semak</option>
<option >Pegawai Pengesyoran</option>
<option >Pegawai Semak HQ</option>
<option >Pegawai Pemantau</option>
</select>
</td>
<td><input name="address_0" type="text" id="address_0" size="20" maxlength="20" /></td>
<td><input name="contactNum_0" type="text" id="contactNum_0" size="20" maxlength="12" /></td>
</tr>
</table>
<input type="button" value="Add" onclick="addRow();" />
<input name="Submit" type="submit" value="Submit" />
<label>
<input name="h" type="hidden" id="h" value="0" />
</label>
</form>
</body>
</html>