Above my head, you have several options for how to do this.
Easy way
<div>:
[...]
<td><div id="dd_cell"><label>Brand</label>
<select name="BX_BRAND[]" class="btn_gri" required="required" onChange="showCateg(this.value)">
<?php
do {
?>
<option value="<?php echo $row_brand['brand']?>"><?php echo $row_brand['brand']?></option>
<?php
} while ($row_brand = mysql_fetch_assoc($brand));
$rows = mysql_num_rows($brand);
if($rows > 0) {
mysql_data_seek($brand, 0);
$row_brand = mysql_fetch_assoc($brand);
}
?>
</select></div>
</td>
[...]
addRow:
[...]
var firstCell = row.insertCell(0);
firstCell.innerHTML = $( "#dd_cell" ).clone();
for(var i=1; i<colCount; i++) {
var newcell = row.insertCell(i);
newcell.innerHTML = table.rows[0].cells[i].innerHTML;
}
[...]
, (, , )
javascript:
function makeDropDown() {
var dd = "<select name=\"BX_BRAND[]\" class=\"btn_gri\" required=\"required\" onChange=\"showCateg(this.value)\">";
<?php
$rows = mysql_num_rows($brand);
if($rows > 0) {
mysql_data_seek($brand, 0);
while ($row_brand = mysql_fetch_assoc($brand)) {
?>
dd += "<option value='\"<?php echo $row_brand['brand']?>'\"><?php echo $row_brand['brand']?></option>";
<?php
}
}
?>
dd += "</select>";
return dd;
}
( ):
[...]
<td><div id="dd_cell"><label>Brand</label>
<script type="text/javascript">
document.write(makeDropDown());
</script></div>
</td>
<td>
<label for="BX_CATEG">Categ.</label>
[...]
, , addRow(tableID):
[...]
var newcell = row.insertCell(0);
newcell.innerHTML = makeDropDown();
for(var i=1; i<colCount; i++) {
newcell = row.insertCell(i);
newcell.innerHTML = table.rows[0].cells[i].innerHTML;
}
[...]