Я создаю для экспонирования элемента, когда будет увеличен ряд кнопки пользователя (+)
эта таблица имеет
2 dropdown - код счета, заказ по ajax и sql
2textarea - деталь, примечание
2textbox - Сумма, Единица
1 кнопка - для загрузки картинки в строку заказа
function fncAdd(){
var tb = document.getElementById('tbl');
var tbody = document.createElement('tbody');
tb.insertBefore(tbody, null);
tr = document.createElement("tr");
tbody.insertBefore(tr, null);
td = document.createElement("td");
var id = document.createTextNode("");
td.insertBefore(id, null);
tr.insertBefore(td, null);
td = document.createElement("td");
var se = document.createElement("select");
se.setAttribute('id','accountcode');
se.options[0] = new Option(" - - Please select - - ","");
se.options[0].selected =1;
td.insertBefore(se, null);
tr.insertBefore(td, null);
td = document.createElement("td");
se = document.createElement("select");
se.setAttribute('id','item');
se.options[0] = new Option(" - - Select accountcode first - - ","");
se.options[0].selected =1;
td.insertBefore(se, null);
tr.insertBefore(td, null);
tb.appendChild(tbody);
}
Аякс
<?php
include 'dbConfig.php';
$query = $db->query("SELECT * FROM accountcode ORDER BY acc_id ASC ");
$rowCount = $query->num_rows;
?>
<td>
<select id="accountcode" class="accountcode">
<option value=""> - - Please select - - </option>
<?php
if($rowCount > 0){
while($row=$query->fetch_assoc()){
echo '<option value="'.$row['acc_id'].'">'.$row['acc_name'].'</option>';
}
}else{
echo '<option value="">Accountcode not available</option>';
}
?>
У меня проблемы. Я не могу ввести условие ajax в fncAdd.
если войти в него. fncДобавить его не работает.
я хочу, чтобы выпадающий список в новой строке имел условие ajax