【发布时间】:2011-07-20 15:46:16
【问题描述】:
所以我是一个初学者,正如标题所说,我希望能够;单击按钮,允许用户向我的表单添加另一个输入字段。我也希望能够删除它。
表单的用途是将学生添加到学生组,然后我将其存储在我的数据库中。
我的表单示例:
<form name="addstudents" id="addstudents" method="post" action="add_students.php">
<table><tr><td>Student:</td><td>
<input type='text' name="1" size='20'></td><td><input type="button" id="add" value="+">
</td><td><input type="button" id="remove" value="-"></td>
</table></form>
但是从我所看到的情况来看,有不同的建议,例如使用 clone() 函数或 Jquery appendto()。
这样做的最佳方法是什么?
谢谢
【问题讨论】:
-
你不需要这个表。您也可以尝试使用标签。
标签: php jquery mysql forms input