am working with that code, when i click addrow button onclick function is not working in IE but working in mozilla, chrome
code is
<td><INPUT type="button" value="Add Row" onClick="addRow('dataTable')" class="btnExample" style="width:70px;"/></td>
<td><INPUT type="button" value="Delete Row" onClick="removeRow('dataTable')" class="btnExample" style="width:85px;"/></td>
</tr>
</table>
<table id="dataTable" style="margin-right:auto">
<tr>
<td>
<?php $result = mysql_query("select customer from customer"); echo "<select name = \"customervisit1\" style=\"width:125px;\">\n"; while ($row = mysql_fetch_assoc($result)) { echo '<option value = "'.$row[customer].'">'.$row[customer].'</option>';} echo "</select>"; ?>
</td>
<td><input type="checkbox" name="chk1[]" value="mon," style="width:65px;"></td>
<td width="29"><input type="checkbox" name="chk1[]" value="tue," style="width:65px;"></td>
<td width="35"><input type="checkbox" name="chk1[]" value="wed," style="width:65px;"></td>
<td width="31"><input type="checkbox" name="chk1[]" value="thu," style="width:65px;"></td>
<td width="24"><input type="checkbox" name="chk1[]" value="fri," style="width:65px;"></td>
<td width="140"><input class="input" type="text" name="pvdescription1" value="<?php if(isset($_POST['pvdescription'])) { echo $_POST['pvdescription'];} ?>" style="width:125px;" ></td>
</tr>
</table>
javascript function is
function addRow(tableID) {
var rowid = parseInt(document.getElementById('customerro').val ue)+1;
var content='';
content +='<td>';
content +='<select name="customervisit'+rowid+'" type="text" id="customervisit'+rowid+'" class="inputt" value = "" style="width:125px;">';
content +='<option value="" >-- select --</option>';
content +='<?php echo $customer; ?>';
content +='</select>';
content +='</td>';
content +='<td><input type="checkbox" name="chk'+rowid+'[]" value="mon," style="width:65px;"></td>';
content +='<td width="29"><input type="checkbox" name="chk'+rowid+'[]" value="tue," style="width:65px;"></td>';
content +='<td width="35"><input type="checkbox" name="chk'+rowid+'[]" value="wed," style="width:65px;"></td>';
content +='<td width="31"><input type="checkbox" name="chk'+rowid+'[]" value="thu," style="width:65px;"></td>';
content +='<td width="24"><input type="checkbox" name="chk'+rowid+'[]" value="fri," style="width:65px;"></td>';
content +='<td width="140"><input type="text" class="input" name="pvdescription'+rowid+'" value="" style="width:125px;" ></td>';
content +='';
document.getElementById('customerro').value = rowid;
var table = document.getElementById(tableID);
var rowCount = table.rows.length;
var row = table.insertRow(rowCount);
row.innerHTML = content;
}
function removeRow(tableID)
{
// grab the element again!
var tbl = document.getElementById(tableID);
// grab the length!
var lastRow = tbl.rows.length;
// delete the last row if there is more than one row!
if (lastRow > 1) tbl.deleteRow(lastRow - 1);
var rowid = parseInt(document.getElementById('customerro').val ue)-1
document.getElementById('customerro').value = rowid;
}
</script>