私はphpテーブルを持っていますが、私の選択肢の行を削除したいのですが、これについてどうやって行くのか分かりません。ここに削除するために私のjavascriptです:ここではphp javascript delete個々の行
// When a delete button is pressed in one of the rows
function deleteCurrentRow(whatrow)
{
//deletes the approriate row according to what button was pressed
if (hasLoaded) {
var delRow = whatrow.parentNode.parentNode;
deleteRows(delRow);//sends the row for deletion to the function to be deleted
}
}
function deleteRows(rowforDeletion)
{
if (hasLoaded) {
var rowPos = rowforDeletion.sectionRowIndex;//postion of the row for deletion
rowforDeletion.parentNode.deleteRow(rowPos);//deletes row
increment = increment -1;
}
}
は私のPHPのテーブルです:
<table border="1" cellspacing="5" id="tblmarkscheme" style="float: center;">
<thead>
<tr>
<th colspan="5">Template</th>
</tr>
<tr>
<th>Mark</th><th>Criteria</th><th>Delete</th>
</tr>
</thead>
<tbody>
<?php
$query = "SELECT maxMark, criteria FROM mark ";
$result = mysql_query($query);
while ($row = mysql_fetch_array($result))
{
echo "<tr>";
echo "<td>" ."<input type = text name = text size = 1 id = mark value = ". $row['maxMark'].">" ."</td>";
echo "<td>"."<textarea>".$row['criteria']. "</textarea>"."</td>";
echo "<td>"."<input type = button value = Delete onclick = deleteCurrentRow(this);/>"."</td>";
echo "</tr>";
}
?>
</tbody><!--elements added onload and when button pressed -->
</table>
私はボタン
、私が行うために必要なすべてが置かれたのonclickビットで戻り、それ –