我正在尝试在表格中呈现html表单。问题是我用AJAX加载页面,然后按钮停止工作(由于tr和td放置)。
有没有办法用html,javascript,php或css来管理它?
这就是我想要完成的事情:
echo "<tr id=\"$I_ID\" class=\"toggleEdit\">";
echo "<form class=\"editRow\" name=\"editRow\" action=\"\" method=\"POST\">";
echo "<input type=\"hidden\" name=\"edit\">";
echo "<input type=\"hidden\" name=\"$thatTable\">";
echo "<input type=\"hidden\" value=\"$I_ID\" name=\"I_ID\">";
echo "<input type=\"hidden\" value=\"$row[1]\" name=\"$columns[1]\">";
echo "<td>$row[1]</td>";
for ($pointer = 2 ; $pointer < $countRows ; ++$pointer) {
echo "<td><input type=\"text\" value=\"$row[$pointer]\" name=\"$columns[$pointer]\"></td>";
}
echo "<td><input type=\"submit\" id=\"submitEdit\" value=\"submit edit\"></td>";
echo "</form>";
echo "</tr>";
这是有效的:
echo "<tr id=\"$I_ID\" class=\"toggleEdit\">";
echo "<td id=\"tdEditRow\">";
echo "<form class=\"editRow\" name=\"editRow\" action=\"\" method=\"POST\">";
echo "<input type=\"hidden\" name=\"edit\">";
echo "<input type=\"hidden\" name=\"$thatTable\">";
echo "<input type=\"hidden\" value=\"$I_ID\" name=\"I_ID\">";
echo "<input type=\"hidden\" value=\"$row[1]\" name=\"$columns[1]\">";
echo "$row[1]";
for ($pointer = 2 ; $pointer < $countRows ; ++$pointer) {
echo "<input type=\"text\" value=\"$row[$pointer]\" name=\"$columns[$pointer]\">";
}
echo "<input type=\"submit\" id=\"submitEdit\" value=\"submit edit\">";
echo "</form>";
echo "</td>";
echo "</tr>";