【发布时间】:2016-03-14 13:04:27
【问题描述】:
我在下面有一个 html 表单。当用户单击添加新按钮时,将生成 2 个新输入字段(warishan 名称和关系)。用户可以添加许多字段。我该如何做到这一点并将数据存储到两个表中,其中名称和联系人转到 userinfo 表 和 userid(last_inserted),warishan 名称和关系转到关系表。有人帮忙吗?
<form id='test' action=""method="post">
Name : <input type="text" id="applicantName" name="applicantName" value="" placeholder="Your Name">
Contact : <input type="text" id="ContactNumber" name="ContactNumber" value="" placeholder="Contact Number">
<label class="label"> <strong> Warishan Names <strong> </label>
<table class="table table-striped table-hover table-bordered">
<thead>
<tr>
<th> # </th>
<th>Warishan Names</th>
<th>Relations</th>
</tr>
</thead>
<tbody>
<tr>
<td>1</td>
<td><input type="text" name="wname" id="wname" value="" placeholder=" "></td>
<td><input type="text" name="wr" id="wr" value="" placeholder=""></td>
</tr>
<tr>
</tbody>
</table>
<button> add new Warishan </button>
<input type="submit" name="submit" value="Submit" class="btn btn-info">
</form>
【问题讨论】: