私は処理チェックボックスの解決策を見つけ、何をする必要があるかを理解していると思っていますが、このコードに削除ボタンを置くという問題があります。ボタンのレイアウトを削除する
<table>
<thead>
<tr>
<th>Camera Name</th>
<th>Date Created</th>
<th>Video Size</th>
<th>Video Length</th>
<th>
<button type="submit" class="deletebutton" name="delete_video" value="Delete" title="Delete the selected videos" onClick="return confirm('Are you sure you want to delete?')">Delete</button><br>
<input type="checkbox" name="radioselectall" title="Select All" />
</th>
</tr>
</thead>
<tbody>
<?php
for($i=0;$i<$num_videos;$i++)
{
//do stuff
//Note: I'm looping here to build the table from the server
?>
<tr >
<td onclick="DoNav('<?php echo $url; ?>');">
<?php echo $result_videos[$i]["camera_name"]; ?>
</td>
<td onclick="DoNav('<?php echo $url; ?>');">
<?php echo setlocalTime($result_videos[$i]["video_datetime"]); ?>
</td>
<td onclick="DoNav('<?php echo $url; ?>');">
<?php echo ByteSize($result_videos[$i]["video_size"]); ?>
</td>
<td onclick="DoNav('<?php echo $url; ?>');">
<?php echo strTime($result_videos[$i]["video_length"]); ?>
</td>
<td>
<form name="myform" action="<?php echo htmlentities($_SERVER['REQUEST_URI']); ?>" method="POST">
<input type="checkbox" name="radioselect" title="Mark this video for deletion"/>
<input type="hidden" name="video_name" value="<?php echo $result_videos[$i]["video_name"]; ?>" />
</form>
</td>
</tr>
...
私はループスルーしてサーバーからテーブルを作成しているが、ヘッダーは明らかにループしていないことに注意してください。私はフォームの削除ボタンをテーブルの各行に置いていました。しかし、今私は複数の削除をしたいので、私は各行にチェックボックスを作成し、ヘッダーに削除ボタンを配置します。また、削除するビデオが分かっているので、video_name
が重要であることにも注意してください。
しかし、私はフォーム(ループ内にあります)にサブミット(削除)していないので、これらのチェックボックスを処理できません。代わりに私は唯一の削除ボタンを持って誰もこれを行うためのより良い方法を提案することはできますか?