<table id="" width="800" cellpadding="0" cellspacing="0" border="1">
<tr>
<th scope="col" bgcolor="#999999">Выполненные работы</th>
<span id="table" width="800">
<table id=""cellpadding="0" cellspacing="0" align="center" width="800" border="1">
<tr>
<th width="300">Выполненные работы</th>
<th width="100">Цена</th>
<th width="100">Норма/час</th>
<th width="100">Сумма</th>
<th width="200">Исполнитель</th>
<th align="center">
<img src="img/Round Thing.png" width="30" height="30" onclick="return addField();"/>
</th>
<th align="center">
<img src="img/x.png" width="25" height="25" onclick="return adeleteField(this);"/>
</th>
</tr>
</table>
вот от сюда считать надо id
любое пофиг...хоть что то вытащить из добавленной строки
var div = document.createElement("tr");
div.innerHTML = "<th width=\"300\"><input size=\"60\" type=\"text\" name=\"rabota"+curFieldNameId+"\" id=\"rabota"+curFieldNameId+"\" value=\"rabota"+curFieldNameId+"\" class=\"textfield\" /></th width=\"100\">"+"<th width=\"110\">1000</th>"+" <th width=\"100\"><label width=\"100\"><input type=\"text\" size=\"5\"name=\"norma"+curFieldNameId+"\" id=\"norma"+curFieldNameId+"\" class=\"textfield\" onBlur=\"sd()\" onChange=\"sd()\" onkeyup=\"document.getElementById('result"+curFieldNameId+"').innerHTML = this.value*1000;\"/></label></th>"+"<th width=\"100\"><div id=\"result"+curFieldNameId+"\" />Сумма</div></th>"+"<th width=\"200\"><select id=\"ispol"+curFieldNameId+"\" name=\"ispol"+curFieldNameId+"\"><option value=\"Нет исполнителья\">нет исполнителя</option><option value=\"Травин Николай\">Николай</option><option value=\"Малинин Вова\">Вова</option> <option value=\"Vlad\">Vlad</option><option value=\"Рамзанов Руслан\">Руслан</option> </select></th>"+"<th><img src=\"img/Round Thing.png\" onclick=\"return addField()\" onMouseOver=\"sd()\" width=\"30\" height=\"30\"></th>"+"<th><img id=\"rabota"+curFieldNameId+"\" src=\"img/x.png\" onclick=\"return deleteField(this)\" onMouseOver=\"sd()\" width=\"25\" height=\"25\"></th>";
вытаскивать я пытаюсь в функции удаления
сама функция
<script>
var countOfFields ="<?php $res = mysql_query("SELECT COUNT(*) FROM rabota WHERE id='$id'");
$row = mysql_fetch_row($res);
$total = $row[0];
echo $total?>";
var curFieldNameId = "<?php $res = mysql_query("SELECT COUNT(*) FROM rabota WHERE id='$id'");
$row = mysql_fetch_row($res);
$total = $row[0];
echo $total?>";
var maxFieldLimit = 100;
function deleteField(a) {
var contDiv = a.parentNode.parentNode;
contDiv.parentNode.removeChild(contDiv);
var fcuk = this.childNodes[0].id
$.ajax({
type: "POST",
url: "http://localhost/arsenal/dell.php",
data: ({fuck:fuck,}),
dataType: 'json',
success: function(data){
var prov = data;
alert(fuck);
if (prov=="ok"){
alert("Данные успешно добавленны");
window.location.href = "index.php"
}
else {
alert("Ошибка сервера повторите попытку");
}
}
});
countOfFields--;
return false;
}