奇妙な問題があります。このコードを使用して、一連のテーブルを生成しています。
<a big form>
*code*
for ($g=1;$g<=$g_number;$g++){
*some random code*
echo"<div id='grupa$g' style='float:left;padding:2px;'><h3>Grupa $g</h3>
<table border='1px' style='display:block; text-align:center';>
<thead>
<th>Name</th><th>V.</th><th>Sets/th><th>m</th>
</thead>
<tbody>";
for ($p=0;$p<$no_of_items[$g];$p++){
echo"<tr>
<td>".$components[$g][1][$p]."</td>
<td>".$components[$g][2][$p]."</td>
<td>".$components[$g][4][$p]."-".$components[$g][5][$p]."</td>
<td>".$components[$g][6][$p]."</td>
<td><form method='post' action='delete_from_groups.php'><input type=submit name=delete value='".$components[$g][0][$p]."'></input></form></td>
</tr>";
}
echo" </tbody>
</table>";
*random code*
}
*some more code*
</end of big form>
右端の列には、各行のフォーム内にボタンが含まれています。最初のテーブルのそのタイプの最初のセルを除いて、すべてが意図したとおりに機能します。そのセルにはボタン (正しい名前) だけが含まれ、その行の他のすべてのセルには正しい値が含まれていますが、フォームを含む必要がある最初のセルにはそれがありません。それはただ
<td><input type="submit" value="411" name="delete"></input></td>
残りはすべて次のとおりです。
<td><form action="delete_from_groups.php" method="post"><input type="submit" value="412" name="delete"></input></form></td>
誰でも理由を説明できますか?